3 Replies Latest reply on May 5, 2006 12:26 PM by Newsgroup_User

    Image Jumps on Swap

    leavitt@buffalo.edu
      Below is my code. When I run this in IE or Firefox get the same behavior. The images swap properly. But, the location for Layer 1 appears shifted from the other 2.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Untitled Document</title>
      <style type="text/css">
      <!--
      #Layer1 {
      position:absolute;
      width:400px;
      height:100px;
      z-index:1;
      visibility: visible;
      left: 28px;
      top: 44px;
      }
      #Layer2 {
      position:absolute;
      width:400px;
      height:100px;
      z-index:1;
      visibility: hidden;
      left: 28;
      top: 44;
      }
      #Layer3 {
      position:absolute;
      width:400;
      height:100px;
      z-index:1;
      left: 28;
      top: 44;
      visibility: hidden;
      }

      -->
      </style>
      <script type="text/JavaScript">
      <!--
      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 [n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers
      .document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
      }

      function MM_showHideLayers() { //v6.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args ))!=null) { v=args[i+2];
      if (obj.style) { obj=obj.style; v=(v=='show')?'visible' v=='hide')?'hidden':v; }
      obj.visibility=v; }
      }
      //-->
      </script>
      </head>

      <body>
      <table width="100%" border="0" cellspacing="1" cellpadding="2">
      <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      </tr>
      <tr>
      <td> </td>
      <td>
      <div id="Layer1" onclick="MM_showHideLayers('Layer1','','hide','Layer2','','show','Layer3','','hide')"><im g src="Movie1.gif" width="400" height="100" /></div>
      <div id="Layer2" onclick="MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','show')"><im g src="Movie2.gif" width="400" height="100" /></div>
      <div id="Layer3" onclick="MM_showHideLayers('Layer1','','show','Layer2','','hide','Layer3','','hide')"><im g src="Movie3.gif" width="400" height="100" /></div></td>
      <td> </td>
      </tr>
      <tr>
      <td> </td>
      <td> </td>
      <td> </td>
      </tr>
      </table>
      </body>
      </html>
        • 1. Re: Image Jumps on Swap
          Level 7
          #Layer2 {
          position:absolute;
          width:400px;
          height:100px;
          z-index:1;
          visibility: hidden;
          left: 28;
          top: 44;
          }
          #Layer3 {
          position:absolute;
          width:400;
          height:100px;
          z-index:1;
          left: 28;
          top: 44;
          visibility: hidden;
          }

          All positioning coordinates must have a unit associated, e.g., 28px....

          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.dreamweavermx-templates.com - Template Triage!
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
          ==================


          "leavitt@buffalo.edu" <webforumsuser@macromedia.com> wrote in message
          news:e3g1mp$4kj$1@forums.macromedia.com...
          > Below is my code. When I run this in IE or Firefox get the same behavior.
          > The
          > images swap properly. But, the location for Layer 1 appears shifted from
          > the
          > other 2.
          >
          > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          > <html xmlns=" http://www.w3.org/1999/xhtml">
          > <head>
          > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
          > <title>Untitled Document</title>
          > <style type="text/css">
          > <!--
          > #Layer1 {
          > position:absolute;
          > width:400px;
          > height:100px;
          > z-index:1;
          > visibility: visible;
          > left: 28px;
          > top: 44px;
          > }
          > #Layer2 {
          > position:absolute;
          > width:400px;
          > height:100px;
          > z-index:1;
          > visibility: hidden;
          > left: 28;
          > top: 44;
          > }
          > #Layer3 {
          > position:absolute;
          > width:400;
          > height:100px;
          > z-index:1;
          > left: 28;
          > top: 44;
          > visibility: hidden;
          > }
          >
          > -->
          > </style>
          > <script type="text/JavaScript">
          > <!--
          > 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.document; n=n.substring(0,p);}
          > if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
          > for(i=0;!x&&d.layers&&i<d.layers.length;i++)
          > x=MM_findObj(n,d.layers.document);
          > if(!x && d.getElementById) x=d.getElementById(n); return x;
          > }
          >
          > function MM_showHideLayers() { //v6.0
          > var i,p,v,obj,args=MM_showHideLayers.arguments;
          > for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) {
          > v=args;
          > if (obj.style) { obj=obj.style;
          > v=(v=='show')?'visible' v=='hide')?'hidden':v; }
          > obj.visibility=v; }
          > }
          > //-->
          > </script>
          > </head>
          >
          > <body>
          > <table width="100%" border="0" cellspacing="1" cellpadding="2">
          > <tr>
          > <td> </td>
          > <td> </td>
          > <td> </td>
          > </tr>
          > <tr>
          > <td> </td>
          > <td>
          > <div id="Layer1"
          > onclick="MM_showHideLayers('Layer1','','hide','Layer2','','show','Layer3','','hi
          > de')"><img src="Movie1.gif" width="400" height="100" /></div>
          > <div id="Layer2"
          > onclick="MM_showHideLayers('Layer1','','hide','Layer2','','hide','Layer3','','sh
          > ow')"><img src="Movie2.gif" width="400" height="100" /></div>
          > <div id="Layer3"
          > onclick="MM_showHideLayers('Layer1','','show','Layer2','','hide','Layer3','','hi
          > de')"><img src="Movie3.gif" width="400" height="100" /></div></td>
          > <td> </td>
          > </tr>
          > <tr>
          > <td> </td>
          > <td> </td>
          > <td> </td>
          > </tr>
          > </table>
          > </body>
          > </html>
          >
          >


          • 2. Re: Image Jumps on Swap
            leavitt@buffalo.edu Level 1
            thanx - works just like a charm
            • 3. Re: Image Jumps on Swap
              Level 7
              Yeah - just the way it's supposed to! 8)

              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.dreamweavermx-templates.com - Template Triage!
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              ==================


              "leavitt@buffalo.edu" <webforumsuser@macromedia.com> wrote in message
              news:e3g8h3$dbb$1@forums.macromedia.com...
              > thanx - works just like a charm