1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
$(document).ready(function() {
//Get all the LI from the #tabMenu_deuxieme UL
$('#tabMenu_deuxieme > li').hover(function(){
//remove the selected class from all LI
$('#tabMenu_deuxieme > li').removeClass('selected');
//Reassign the LI
$(this).addClass('selected');
//Hide all the DIV in .boxBody_deuxieme
$('.boxBody_deuxieme div').slideUp('1500');
//Look for the right DIV in boxBody_deuxieme according to the Navigation UL index, therefore, the arrangement is very important.
$('.boxBody_deuxieme div:eq(' + $('#tabMenu_deuxieme > li').index(this) + ')').slideDown('1500');
}).mouseover(function() {
//Add and remove class, Personally I dont think this is the right way to do it, anyone please suggest
$(this).addClass('mouseover');
$(this).removeClass('mouseout');
}).mouseout(function() {
//Add and remove class
$(this).addClass('mouseout');
$(this).removeClass('mouseover');
});
}); |
Partager