jQuery Question
- Started
- Last post
- 5 Responses
- 3030
I presume that you have a div inside <li> item of list ul.tab.
So, use jquery bind to bind multiple events; bind evets to <li> items$("ul.tab li").bind({
mouseenter: function(){
$("#panel").slideDown();
},
mouseleave: function() {
$("#panel").slideUp();
}
});In your css the panel to you want to toggle - make it hidden by default (display:none);
Also - list items - add position: relative;Hope this helps you.
- "Ahaaaaa" moment.
I'll give it a shot when I get home.duckseason
- "Ahaaaaa" moment.
- 3030
Just one thing - if the behavior is awkward, try do modify the code:
$("#panel").stop().slideDown();
Same for slideUp:
$("#panel").stop().slideUp();
- dbloc0
if display = none it's not going to show up for it to check, you may need to check for something else
- duckseason0
I had that in place to prevent the panel slideDown from triggering again if the mouse happened mouse out of the panel and back over the tab.
Before added, it would slide up and then slide back down.