Reputation: 263
i am learning jQuery from tusplus website and i want to have a FAQ section with questions and when user point to the question, the right answer slided down.
I've implemented it but it works good only in IE and Chrome, but bad in Mozilla. Anyone know why? Thanks.
Live demo: www.lukashamrla.cz/pokus.html
Code:
$(document).ready(function(){
$("dd").addClass("hide");
$("dt").on("mouseenter", function(){
$(this).next().slideDown().siblings('dd').slideUp();
})
});
Upvotes: 2
Views: 57
Reputation: 11862
I believe it's the .siblings('dd')
that may be mis-behaving, tweak this to slideUp()
only of those that are hidden via :visible
to prevent .slideUp()
actioning dd
elements regardless of it's status:
$("dd").addClass("hide");
$("dt").on("mouseenter", function () {
$(this).next().slideDown().siblings('dd:visible').slideUp();
});
Upvotes: 2