Hey!
First of all, I am quite new to jQuery and Javascript, so please help me understand how to fix this issue.
I am using tabs on a new site that I am developing, and used
this tutorial to get started with it.
One of the changes I made to the jQuery-script, was to change from
click to hover on the tabs.
I made the tabs using jQuery 1.3.2 and jQuery UI 1.5.3. I was happy with the result, and it worked as expected.
But, later I changed to jQuery 1.4.2 and jQuery UI 1.8.1, and the behavior of the hover-function was changed a lot.
As you can see from the example I have put up here, the hover-function is loading the content both when I mouseover and mouseout, witch is quite annoying.
Click to see the example
The code I am currently are using is the following.
-
//ITpro SmartBar (tabs)
-
$(document).ready(function() {
- $(".smartbar-content").hide();
-
$("ul.smartbar li:first").addClass("selected").show(); //Activate first tab
-
$(".smartbar-content:first").show(); //Show first tab content
-
$("ul.smartbar li").hover(function() {
$("ul.smartbar li").removeClass("selected");
-
$(this).addClass("selected"); //Add "selected"-class to activate the selected tab
-
$(".smartbar-content").hide(); //Hide all tab content
-
var activeTab = $(this).find("a").attr("rel");
-
if ($.browser.msie)
-
{$(activeTab).show();}
- else
{$(activeTab).fadeIn();}
-
return false;
-
});
-
});
Could somebody point me to the right direction, or help me re-write the code?
The important elements is the hover-event and the fadeIn.
Thanks for replies!