Tuesday, 15 July 2014

javascript - Jquery Toggle: closing a toggle element -



javascript - Jquery Toggle: closing a toggle element -

i have query works fine except when click on toggle item open, slides slides downwards right away. can see here.

the query :

$(".faqtopics").click(function(event) { $("div.faqtext").slideup(400); $(this).next("div.faqtext").slidetoggle(); });

thanks lot help!

use .stop()

description: stop currently-running animation on matched elements.

code

$(".faqtopics").click(function(event) { $("div.faqtext").stop(true).slideup(400); $(this).next("div.faqtext").stop(true).slidetoggle(); });

demo

javascript jquery toggle slidetoggle

No comments:

Post a Comment