Created
June 20, 2018 13:47
-
-
Save francoispeyret/6186d4f3860b29da26a3ab35d5cd63a6 to your computer and use it in GitHub Desktop.
faq.js improvement slideToggle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Roll out answer | |
*/ | |
$(".gomakoil_faq_page .questions").click(function (e) { | |
e.preventDefault(); | |
var answer_page_link = $(this).find(".icon_fag"); | |
var answer_block = $(this).next(); | |
if ($(this).hasClass('as_url')) { | |
location.href = answer_page_link.attr('href'); | |
return false; | |
} | |
if ($(this).hasClass('active')) { | |
$(this).removeClass('active'); | |
answer_page_link.hide(); | |
} else { | |
$(this).addClass('active'); | |
answer_page_link.fadeIn(); | |
} | |
// AXOME : add stop() function to clear animation's queue | |
answer_block.stop(true).slideToggle("slow"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment