Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Location
    South Yorkshire, ENG
    Posts
    102
    Tokens
    0

    Default How do you create a rollover link?

    you know the sort i mean...
    put ur cursor over the image link and it changes?

    any help will be grateful

    faerie

  2. #2
    Join Date
    Feb 2005
    Posts
    1,411
    Tokens
    0

    Latest Awards:

    Default

    I think this is it but if it doesn't work just send me a message and ill try to sort it out.

    SCRIPT LANGUAGE="JAVASCRIPT">
    <!--

    function roll(img_name, img_src)
    {
    document[img_name].src = img_src;
    }

    //-->
    </SCRIPT>

    Change the img_src's with the link to the images and the image name to the name u have called it e.g bottle.jpg.

    There Ya Go

    Matt (Mattz.net)

  3. #3
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    hered da right script

    Quote Originally Posted by <James>
    <style>
    A:link {
    COLOR: white; TEXT-DECORATION: [COLOR=Red
    none[/COLOR]
    }
    A:visited {
    COLOR: white; TEXT-DECORATION: none
    }
    A:active {
    COLOR: white; TEXT-DECORATION: none
    }
    A:hover {
    COLOR: #0000FF; TEXT-DECORATION: none
    </style>
    you can change the bits in red to the following:

    Under line (underlines)
    Score Out(Scores it out, i think :s)
    none (just changes the colour)


    MAKE SURE THIS GOES IN THE <HEAD> SECTION!! lol. If you are using dreamweaver however, go to insert>interactive images>Flash text

    I hope this helps. If you need furtjar assistance, just ask

    http://www.stupidian.com
    (contains mild swearing)

  4. #4
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    or if you ment roll over images (wich can be used as links)

    Jam this in the head
    HTML 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>
    Then add this attribute the the body tag so its

    onload="MM_preloadImages(' Image That rolls over to ')"

    <body onload="MM_preloadImages(' Image That rolls over to ')">

    Then just use this code where you wnat the roll over image / link

    <a href=" URL TO GO TO (link loction ) " onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('mr_Image','',' Image That rolls over to ',1)"><img src=" Normal Image " " name="mr_Image" border="0" id="mr_Image" /></a>

    the bold bits need to be edited to your images



    (i was boared)
    Last edited by Mentor; 23-02-2005 at 10:18 PM.

  5. #5
    Join Date
    Oct 2004
    Location
    Scotland
    Posts
    2,280
    Tokens
    1,075

    Latest Awards:

    Default

    well done mentor, lol. Is the score out right?

    http://www.stupidian.com
    (contains mild swearing)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •