I want to use slideDown and slideUp in jquery, but do not want to use slideToggle on one element. Here is code which I use, but not working correctly
$(".p8").click(function(){
$(".u8").slideDown(300);
$(".u8").slideUp(300);
});
Css I use
<li class="p8">
<ul class="u8">
<li><div><form><input type="text"></form></div></li>
</ul>
</li>
The p8 is css icon, I want when it clicked, slideDown function trigger on u8, when again clicked slideUp function trigger on u8. I has a form in u8 div.
Now If I use slideToggle then slideDown trigger correctly, but when I click on form's input, it goes to slideUp, therefore I do not want to use Toggle.
Try this... and tell me...
Min version:
Extended version:
If you need to do other, if icon is slidedUp or SlidedDown:
prevent event propagation on input click
add this code:
Working example :: http://jsfiddle.net/Frogmouth/xv0Lk9qf/1/