Hello everyone. I'm not sure why this toggle function isn't working. I have a basic arrow with CSS styles that is initially pointing to the right and I want to point it downward on a click event.
- <script type="text/javascript">
- $("#arrow-right").click(function() {
$(this).toggleClass("arrow-down", 1000);
});
- </script>
- <style type="text/css">
- #arrow-right {
- border-bottom: 12px solid transparent;
- border-left: 12px solid #4a3571;
- border-top: 12px solid transparent;
- position: relative;
- top: 19px;
- left: 37px;
- height: 0;
- width: 0;
- }
- .arrow-down {
- width: 0;
- height: 0;
- border-left: 12px solid transparent;
- border-right: 12px solid transparent;
- border-top: 12px solid #4a3571;
- position: relative;
- top: 10px;
- left: 22px;
- }
- </style>
HTML:
- <div id="arrow-right" class="arrow-down"></div>
I'm not sure why this isn't working. Does anyone see anything else I'm not doing?