Announcement

Collapse
No announcement yet.

Rollover image 2 days driving me mad please Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Rollover image 2 days driving me mad please Help

    Hi

    Can any of you experts help please. I am struggling with setting up rollover images. Here is some of the code I have used from the advance users guide. I have also searched and read through the forum with no luck. maybe I have I have a typo not being a web developer I am struggling .

    !!<
    <center>
    <a href="http://www.inkbypost.co.uk/acatalog/Brother.html" target="_self"
    onmouseover="SwapImage('Brother Ink','/NOT_CATALOG\new website\rollover\brother_ro.jpg')"
    onmouseout="RestoreImage()"><img src="/NOT_CATALOG\new website\rollover\brother_l.jpg"
    alt="Brother Cartridges" border="0" name="Brother ink" /></a>

    The rollover images are on the homepage.

    www.inkbypost.co.uk

    any help would be much appreciated.

    Mick.
    Mick

    www.inkbypost.co.uk

    #2
    I haven't checked, but do you have the script referenced in the head?

    You should have this in your fragment:

    Code:
    !!<<a href="www.yoururl.co.uk" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','img2',1)"><img name="Image1" border="0" src="img1"></a>>!!
    This in you body tag:

    Code:
    onLoad="MM_preloadImages('img2')"
    Which from what I've seen seems to be in place.

    This in your <head>:

    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    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_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_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];}
    }
    //-->
    </script>
    I hope that makes sense?

    Army Gore-tex
    Winter Climbing Mitts
    webD's Blog: Website design, SEO and other ramblings…
    Twitter LinkedIN

    If you think a post is good, rate it!

    Find the answers in the Knowledge Base | Have you read the User Guides

    Comment


      #3
      Open Css, Insert
      Code:
       #rollovereffect li a{ 
      	background-image: url("../NOT_CATALOG/new website/rollover/brother_ro.jpg"); 
      	width: image width; 
      	Height: Image Height; 
      } 
      
      #rollovereffect li a:hover{ 
      	background-image: url("../NOT_CATALOG/new website/rollover/brother_l.jpg"); 
      	width: image width; 
      	Height: Image Height; 
      }
      Then in the html

      Code:
      <div id="rollovereffect"><a href="http://www.inkbypost.co.uk/acatalog/Brother.html">Link Text</a><br>
      </div>
      www.simonstaton.co.uk

      Comment


        #4
        Thanks for the response guys

        Been away so I apologise for the late reply. Will try these 2 methods tomorrow. Quick question do I just enter the script / txt between the !!< >!!

        Thanks Mick
        Mick

        www.inkbypost.co.uk

        Comment

        Working...
        X