Comment ajouter un Onmouseout

Fermé
hichamdeb Messages postés 125 Date d'inscription mercredi 12 septembre 2007 Statut Membre Dernière intervention 17 mars 2020 - 5 août 2011 à 12:37
katsuo49 Messages postés 330 Date d'inscription vendredi 19 juin 2009 Statut Membre Dernière intervention 11 novembre 2014 - 6 août 2011 à 01:34
Bonjour

cela fait 2 jours que je me creuse la tête en vain! c'est assez banale comme question mais il faut dire que je suis pas très douer en JS :p
Je voudrai rajouter un onmouseout quelque part sur mon code afin de rajouter le code suivant "min-width:310px;" sur le code css

code initial

background: url(images/1.jpg) repeat scroll 0%;
width:310px;


AVEC ONMOUSEOUT

background: url(images/1.jpg) repeat scroll 0%;
width:310px;
min-width:310px;


Voici Mon code

<style type="text/css">
 
 
.jimgMenu ul li.landscapes a {
 
	background: url(images/1.jpg) repeat scroll 0%;
	width:310px;
	min-width:310px;
}
 
.jimgMenu ul li.people a {
	background: url(images/2.jpg) repeat scroll 0%;
}
 
.jimgMenu ul li.nature a {
	background: url(images/3.jpg) repeat scroll 0%;
}
.jimgMenu ul li.abstract a {
	background: url(images/4.jpg) repeat scroll 0%;
}
 
 
</style>
 
 
 
<!--[if IE]>
<style type="text/css">.jimgMenu {position:relative;width:555px;height:160px;overflow:hidden;margin-left:0px;}</style>
<![endif]-->
<script type="text/javascript">
$(document).ready(function () {
 
  // find the elements to be eased and hook the hover event
  $('div.jimgMenu ul li a').hover(function() {
 
    // if the element is currently being animated (to a easeOut)...
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "310px"}, {duration: 450, easing:"easeOutQuad"});
    } else {
      // ease in quickly
      $(this).stop().animate({width: "310px"}, {duration: 400, easing:"easeOutQuad"});
    }
  }, function () {
    // on hovering out, ease the element out
    if ($(this).is(':animated')) {
      $(this).stop().animate({width: "60px"}, {duration: 400, easing:"easeInOutQuad"})
    } else {
      // ease out slowly
      $(this).stop('animated:').animate({width: "60px"}, {duration: 450, easing:"easeInOutQuad"});
    }
  });
 
 
});
 
</script>
A voir également:

1 réponse

katsuo49 Messages postés 330 Date d'inscription vendredi 19 juin 2009 Statut Membre Dernière intervention 11 novembre 2014 25
6 août 2011 à 01:34
Il nous faudrait le code complet de la page. Là tu n'en donnes qu'une partie. Aussi ou penses-tu que la souris se trouveras avant que tu n'es besoin d'un "min-width: 310px;" ?
0