/* author: INFO SERVICE */ /* creation date: 4/25/2013 */ /*var mcolor = new Array('#000000','#ed1b2e','#94c1e8','#56ac23','#ce6901','#0078c4','#e96499','#ffdb00');*/ var mcolor = new Array('#000000','#ffffff','#ffffff','#ffffff','#ffffff','#ffffff','#ffffff','#ffffff'); var phid = 0; $(function() { $("#sdt_menu").hover(function() { if ($('#personnage').length > 0){ $("#personnage").delay(200).animate({ "top": "15px", "left": "600px", },1500,'easeInOutElastic'); }; }, function() { if ($('#personnage').length > 0){ $("#personnage").delay(200).animate({ "top": "15px", "left": "0px", },1500,'easeInOutElastic'); }; }); /** * for each menu element, on mouseenter, * we enlarge the image, and show both sdt_active span and * sdt_wrap span. If the element has a sub menu (sdt_box), * then we slide it - if the element is the last one in the menu * we slide it to the left, otherwise to the right */ $('#sdt_menu > li.sdt_bouton').bind('mouseenter',function(){ /*if ($('#personnage').length > 0){ $("#personnage").delay(200).animate({ "top": "15px", "left": "600px", },1500,'easeInOutElastic'); };*/ var $elem = $(this); $elem/*.find('img') .stop(true) .animate({ 'width':'194x', 'height':'116px', 'left':'0px' },400,'easeOutBack') .andSelf()*/ .find('.sdt_wrap') .stop(true) .animate({'top':'55px'},500,'easeOutBack') .andSelf() .find('.sdt_link') .stop(true) .animate({color:mcolor[$elem.index()],fontWeight: 'bold',fontSize:'18px'},500) .andSelf() .find('.sdt_active') .stop(true) .animate({'height':'200px'},300,function(){ var $sub_menu = $elem.find('.sdt_box'); if($sub_menu.length){ var left = '193px'; if($elem.parent().children().length == $elem.index()+1) left = '-229px'; if($elem.parent().children().length == $elem.index()+2) left = '-229px'; /*alert ($elem.id);*/ if($sub_menu.attr('id') == 'mjo') left = '-399px'; if($sub_menu.attr('id') == 'tital') left = '-399px'; $sub_menu.show().animate({'left':left},200); } }); }).bind('mouseleave',function(){ /*if ($('#personnage').length > 0){ $("#personnage").delay(200).animate({ "top": "15px", "left": "0px", },1500,'easeInOutElastic'); };*/ var $elem = $(this); var $sub_menu = $elem.find('.sdt_box'); if($sub_menu.length) $sub_menu.hide().css('left','0px'); $elem.find('.sdt_active') .stop(true) .animate({'height':'0px'},300) /*.andSelf().find('img') .stop(true) .animate({ 'width':'0px', 'height':'0px', 'left':'85px'},400)*/ .andSelf() .find('.sdt_link') .stop(true) .animate({color:'#ffffff',fontWeight: 'normal',fontSize:'13px'},500) .andSelf() .find('.sdt_wrap') .stop(true) .animate({'top':'10px'},500); }); });