IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

script éprouvé mais de rollover défaillant


Sujet :

JavaScript

  1. #1
    Provisoirement toléré Avatar de charleshbo
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    222
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 222
    Points : 125
    Points
    125
    Par défaut script éprouvé mais de rollover défaillant
    J'ai aucune idée pourquoi... je me suis servi d'un code que j'ai déjà utilisé pour faire mes boutons avec des images rollover et ça ne veux même pas fonctionner!

    Voici le code du fichier... mes fichiers sont bien linkés en plus.. voyez-vous un problème?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
     
    <html>
    <head>
    <title>KB pods : 21st century kitchens, bathrooms and facilities</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/javascript" src="scripts/imageOP.js"></script>
    <link type="text/css" rel="stylesheet" href="styles/main.css">
    <link rel="SHORTCUT ICON" href="images/kb.ico">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/index_btnOn_03.jpg','images/index_btnOn_04.jpg','images/index_btnOn_05.jpg','images/index_btnOn_06.jpg','images/index_btnOn_07.jpg','images/index_btnOn_08.jpg','images/index_btnOn_09.jpg','images/index_btnOn_10.jpg')">
    <center>
    <br>
    <div style="width:1000px;" align="right">
     <font color="#666666"><a href="#" class="top_links">sitemap</a> | <a href="#" class="top_links">français</a></font>
    </div>
    <table id="Table_01" width="1000" height="678" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td colspan="3" width="346" height="165">
    			<img src="images/index_01.jpg" width="346" height="165" alt=""></td>
    		<td colspan="6" width="654" height="165">
    			<img src="images/index_02.jpg" width="654" height="165" alt=""></td>
    	</tr>
    	<tr>
    		<td width="124" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_prebuilt','','images/index_btnOn_03.jpg',0);MM_displayStatusMsg('Prebuilt');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Prebuilt');return document.MM_returnValue"><img src="images/index_03.jpg" width="124" height="36" alt="" border="0" name="btn_prebuilt" id="btn_prebuilt"></a></td>
    		<td width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_products','','images/index_btnOn_04.jpg',0);MM_displayStatusMsg('Products');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Products');return document.MM_returnValue"><img src="images/index_04.jpg" width="125" height="36" alt="" border="0" name="btn_products" id="btn_products"></a></td>
    		<td colspan="2" width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_process','','images/index_btnOn_05.jpg',0);MM_displayStatusMsg('Process');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Process');return document.MM_returnValue"><img src="images/index_05.jpg" width="125" height="36" alt="" border="0" name="btn_process" id="btn_process"></a></td>
    		<td width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_cost','','images/index_btnOn_06.jpg',0);MM_displayStatusMsg('Cost');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Cost');return document.MM_returnValue"><img src="images/index_06.jpg" width="125" height="36" alt="" border="0" name="btn_cost" id="btn_cost"></a></td>
    		<td width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_faq','','images/index_btnOn_07.jpg',0);MM_displayStatusMsg('FAQ');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('FAQ');return document.MM_returnValue"><img src="images/index_07.jpg" width="125" height="36" alt="" border="0" name="btn_faq" id="btn_faq"></a></td>
    		<td width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_about','','images/index_btnOn_08.jpg',0);MM_displayStatusMsg('About');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('About');return document.MM_returnValue"><img src="images/index_08.jpg" width="125" height="36" alt="" border="0" name="btn_about" id="btn_about"></a></td>
    		<td width="125" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_contact','','images/index_btnOn_09.jpg',0);MM_displayStatusMsg('Contact');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Contact');return document.MM_returnValue"><img src="images/index_09.jpg" width="125" height="36" alt="" border="0" name="btn_contact" id="btn_contact"></a></td>
    		<td width="126" height="36">
    			<a href="#" onMouseOver="MM_swapImage('btn_home','','images/index_btnOn_10.jpg',0);MM_displayStatusMsg('Home');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Home');return document.MM_returnValue"><img src="images/index_10.jpg" width="126" height="36" alt="" border="0" name="btn_home" id="btn_home"></a></td>
    	</tr>
    	<tr>
    		<td colspan="9" width="1000" height="25">
    			<img src="images/index_11.jpg" width="1000" height="25" alt=""></td>
    	</tr>
    	<tr>
          <td colspan="9" width="1000" height="409" style="background-image:url(images/ext_middle.jpg);background-repeat:repeat-y;padding-left:10px;padding-right:10px;" valign="top"> 
            <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    		     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
     
            <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    		     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->
          </td>
    	</tr>
    	<tr>
    		<td colspan="9" width="1000" height="9">
    			<img src="images/index_13.jpg" width="1000" height="9" alt=""></td>
    	</tr>
    	<tr>
    		<td colspan="9" width="1000" height="29" style="background-image:url(images/index_14.jpg);background-repeat:no-repeat;">
    		<div class="small_text" align="right" style="padding-right:10px;">Copyright &copy; 2008 KB Pods - All rights reserved</div>
    		</td>
    	</tr>
    	<tr>
    		<td colspan="9" width="1000" height="4">
    			<img src="images/index_15.jpg" width="1000" height="4" alt=""></td>
    	</tr>
    	<tr>
    		<td>
    			<img src="images/spacer.gif" width="124" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="125" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="97" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="28" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="125" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="125" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="125" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="125" height="1" alt=""></td>
    		<td>
    			<img src="images/spacer.gif" width="126" height="1" alt=""></td>
    	</tr>
    </table>
    <div style="width:1000px;" align="right">
    <div class="text_conception">Conception : <a href="http://commparlimage.ca/" class="top_links">Communication par l'image</a></div>
    </div>
    </center>
    </body>
    </html>

  2. #2
    Expert confirmé
    Avatar de le_chomeur
    Profil pro
    Développeur informatique
    Inscrit en
    Février 2006
    Messages
    3 653
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Février 2006
    Messages : 3 653
    Points : 4 835
    Points
    4 835
    Par défaut
    sans ton script ça risque d'être dur , de plus un simple "ça ne marche pas" n'est pas très simple a identifié , as tu un message d'erreur ou autre ?

  3. #3
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814
    Par défaut
    J'ai pris ma boule de cristal aujourd'hui


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
     if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
       document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
     else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
     
    function MM_swapImage() { //v3.0
     var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
      if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
     
    var vis = new Array();
     
    function swap_couche(couche)
    {
        if (vis[couche] == 'hide')
        {
            MM_swapImage('triangle'+couche,'','img/design/puces/cacher.gif?'+couche,1)
            MM_showHideLayers('Layer'+couche,'','show');
            vis[couche] = 'show';
        }
        else
        {
            MM_swapImage('triangle'+couche,'','img/design/puces/voir.gif?'+couche,1)
            MM_showHideLayers('Layer'+couche,'','hide');
            vis[couche] = 'hide';
        }
    }
     
    function MM_findObj(n, d) { //v4.0
     var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
       d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
     if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
     for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
     if(!x && document.getElementById) x=document.getElementById(n); return x;
    }
     
    function MM_showHideLayers() { //v3.0
     var i,p,v,obj,args=MM_showHideLayers.arguments;
     for (i=0; i<(args.length-2); i+=3) 
     if ((obj=MM_findObj(args[i]))!=null) { 
    	v=args[i+2];
       if (obj.style) { 
       	obj=obj.style; 
    	v=(v=='show')?'block':(v='hide')?'none':v;
     
    	}
      obj.display=v;
     
     }
    }

    <img onMouseOver="MM_swapImage('btn_prebuilt','','images/index_btnOn_03.jpg',0);MM_displayStatusMsg('Prebuilt');return document.MM_returnValue" onMouseOut="MM_swapImgRestore();MM_displayStatusMsg('Prebuilt');return document.MM_returnValue" src="images/index_03.jpg" width="124" height="36" alt="" border="0" name="btn_prebuilt" id="btn_prebuilt"> </td>

  4. #4
    Provisoirement toléré Avatar de charleshbo
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    222
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 222
    Points : 125
    Points
    125
    Par défaut
    Non, je n'obtiens aucun message d'erreur. J'ai pris le code tel quel sur un site que j'ai déjà réalisé. Il ne fait que pas fonctionner

    Voilà le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
     
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
     
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
     
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
     
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
     
    function MM_displayStatusMsg(msgStr) { //v1.0
      status=msgStr;
      document.MM_returnValue = true;
    }
    C'est un code que j'ai trouvé sur le web et qui a toujours fonctionner, a date... Se peut-il qu'il y ait des configurations à faire au niveau du serveur?

  5. #5
    Provisoirement toléré Avatar de charleshbo
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    222
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 222
    Points : 125
    Points
    125
    Par défaut
    Bon.. j'ai honte.. ça pouvait pas être plus stupide comme erreur. Mon script marchait bel et bien... sauf qu'il remplaçait mon image... par exactement la même... un détail qui m'a échappé.. j'ai mal créé mes images de over...

    Pour le découvrir j'ai placer des "Alert" dans chaque fonction du script pour savoir si le pointeur passait par la et c'est la que j'ai découvert que oui.

    En espérant que mon erreur empêchera d'autres personnes de trop se casser la tête!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Script PHP de téléchargement éprouvé - Mais Pb ?
    Par islogged dans le forum Langage
    Réponses: 1
    Dernier message: 02/12/2012, 01h46
  2. Réponses: 1
    Dernier message: 24/12/2010, 13h40
  3. Un petit script facile mais qui bloque
    Par Whombat dans le forum Langage
    Réponses: 4
    Dernier message: 20/10/2007, 20h15
  4. Execution de script batch mais pas ds un .bat :
    Par Billy GunZ dans le forum C
    Réponses: 7
    Dernier message: 26/09/2006, 18h03
  5. Réponses: 9
    Dernier message: 25/01/2005, 14h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo