function montre(id) { var d = document.getElementById(id); for (var i = 0; i<=10; i++) { if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';} } if (d) {d.style.display='block';} } function swapImage(element) { var source = $(element).attr('src'); source = source.substring(0, source.length - 4); if (source.substring(source.length - 3) == "_f2") { $(element).attr('src',source.substring(0, source.length - 3)+".png"); } else { $(element).attr('src', source + "_f2.png"); } } $(document).ready(function() { MM_preloadImages('http://www.trucdenana.com/img/menu/alaune_f2.png','http://www.trucdenana.com/img/menu/beaute_f2.png','http://www.trucdenana.com/img/menu/deco_f2.png','http://www.trucdenana.com/img/menu/hightech_f2.png','http://www.trucdenana.com/img/menu/mode_f2.png','http://www.trucdenana.com/img/menu/bienetre_f2.png','http://www.trucdenana.com/img/menu/sexo_f2.png','http://www.trucdenana.com/img/menu/recettes_f2.png'); MM_preloadImages('http://www.trucdenana.com/img/menu/foudre_f2.png','http://www.trucdenana.com/img/menu/shopping_f2.png','http://www.trucdenana.com/img/menu/video_f2.png','http://www.trucdenana.com/img/menu/jeux_f2.png','http://www.trucdenana.com/img/menu/test_f2.png','http://www.trucdenana.com/img/menu/astro_f2.png','http://www.trucdenana.com/img/menu/dossier_f2.png'); }); $(document).ready(function() { montre(); $(".rubrique > ul").each(function () { $(this).bind('mouseleave', function () { $(this).slideUp(10);})}); $(".rubrique").each(function () { $(this).bind('mouseleave', function () { $(this).children("ul").slideUp(10);})}); $(".rubrique").each(function () { $(this).bind('mouseenter', function () { $(this).children("ul").show(20)})}); // $("#menu0").mouseover(function () {$(this).children("ul").slideDown('fast');}); // $("#menu1").mouseover(function () {$("#smenu1").slideDown('fast');}); // $("#menu2").mouseover(function () {$("#smenu8").slideDown('fast');}); // $("#menu3").mouseover(function () {$("#smenu3").slideDown('fast');}); // $("#menu4").mouseover(function () {$("#smenu4").slideDown('fast');}); // $("#menu5").mouseover(function () {$("#smenu5").slideDown('fast');}); // $("#menu6").mouseover(function () {$("#smenu6").slideDown('fast');}); // $("#menu7").mouseover(function () {$("#smenu7").slideDown('fast');}); $("#img-dossier").mouseover(function () {swapImage('#img-dossier')}).mouseout(function () {swapImage('#img-dossier')}); $("#img-astro").mouseover(function () {swapImage('#img-astro')}).mouseout(function () {swapImage('#img-astro')}); $("#img-quiz").mouseover(function () {swapImage('#img-quiz')}).mouseout(function () {swapImage('#img-quiz')}); $("#img-jeux").mouseover(function () {swapImage('#img-jeux')}).mouseout(function () {swapImage('#img-jeux')}); $("#img-videos").mouseover(function () {swapImage('#img-videos')}).mouseout(function () {swapImage('#img-videos')}); $("#img-shopping").mouseover(function () {swapImage('#img-shopping')}).mouseout(function () {swapImage('#img-shopping')}); $("#img-foudres").mouseover(function () {swapImage('#img-foudres')}).mouseout(function () {swapImage('#img-foudres')}); $(".cleanable").each(function () { $(this).bind('focus', function () { $(this).val(''); })}); });