I'm currently using jQuery tools tabs plugin. I'm at a point where it works pretty well but I need some added functionality which isn't included.
The functionality i'm looking for is when a tab is activated and the user moves their mouse outside of the tabs content area, the tab is collapsed. (Almost like a dropdown menu with css)
I so far have the following code:
$('#main-content > div').mouseleave(function() {
var api = $('.nav').data('tabs');
if (api.getIndex() == $('.nav a').parent('li').index()) {
api.getCurrentPane().hide().removeClass('current');
}
});
$(".nav").tabs("#main-content > div", {
initialIndex: 5,
event: 'mouseover',
});
The code only seems to work on the last tab and i'm not sure why.
Demo: http://www.edisonfordinsure.co.uk/other/portal/idea/
Any help would be greatly appreciated.