Is there a way to toggle the bottom
property of a div when clicking its child anchor tag?
<div class="nav" :class="{ 'full-width': isFullWidth }">
<a class="toggle-button" @click="toggleNav"><i class="fa fa-angle-down"></i></a>
</div>
Upon clicking the anchor tag, I have this jQuery code:
$('.toggle-button').click(function () {
$(this).parent().animate({ bottom: 0 }, 200)
}, function () {
$(this).parent().animate({ bottom: -30 }, 200)
})
However, currently, I need to click twice for the bottom
property to change and subsequent clicks do not trigger any action. What could be causing this issue?
If you can figure out what's wrong, please let me know!