I’m trying to make a navigation area and am trying to switch tabs with the active variable.
This is just for the nav button, but later I’d like to make a rotator too by switching the variable.
Here is my code:
active = 1;
function hover() {
$(nav1).live('mouseenter', function() {
active = 2;
});
if ( active == 1) {
$(tab1).fadeIn('fast');
}
else if ( active != 1) {
$(tab1).fadeOut('slow');
}
if ( active == 2) {
$(tab2).fadeIn('fast');
}
else if ( active != 2) {
$(tab2).fadeOut('slow');
}
}
hover();
You should try
Note that you need four vars tab1, tab2, nav1 and nav2 for this code.