.slideToggle Javascript issue with search form
-
Hey guys,
I have a search form in my header that I want to stick to the top of the screen when scrolling just like I do with my menu. At this time, I’m able to have it stick where I want and all that. The only problem is that I need it to slide to the left when I toggle the search button (the box is hidden until toggled). Currently, it slides to the bottom nicely and then jumps to the left of the button, where I want it to end up. However, this doesn’t look smooth.
Here is my JS:
/* * Toggles Header Search On and Off */ jQuery(document).ready(function($){ $(".search-toggle").click(function(){ $("#search-container").slideToggle('slow', function(){ $('.search-toggle').toggleClass('active'); }); // Optional return false to avoid the page "jumping" when clicked return false; }); });
Please let me know what I need to change!
Thanks,
Brett
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘.slideToggle Javascript issue with search form’ is closed to new replies.