here:
http://www.jsfiddle.net/JEXru/1/
i don't know how to make it so if you hover over the slide it stays active ... help?
here:
http://www.jsfiddle.net/JEXru/1/
i don't know how to make it so if you hover over the slide it stays active ... help?
Change your javascript to this:
$(function() {
$('.slide').hide();
$('.title:first').css({
'margin-left': '1px #333 solid'
});
$('ul#horzAccordion ul').hover(
function() {
var slideLink = $(this).children('a').attr('name');
$(slideLink).animate({
'width': '320px'
}).show();
}, function() {
var slideLink = $(this).children('a').attr('name');
$(slideLink).animate({
'width': '0px'
}, 300).hide();
});
});
What you were doing is setting the hover event on just the link which only encompasses the first LI (the link surrounding the list item is invalid html by the way you will want to move that to inside the LI). So when your mouse moved away from the link it closed. The updated javascript sets the hover on the interior UL so that you can interact with the shown contents.
Let me know if you have any questions on the above.
edit: code formatting.
For what you want, you don't need any Javascript. Add these to your CSS:
#horzAccordion ul li.slide { display: none; }
#horzAccordion ul:hover li.slide { display: block; }
Then remove your hover jQuery function and $('.slide').hide();.