Web Analytics Made Easy -
StatCounter adding links to images in a image rotating script - help needed. - CodingForum

Announcement

Collapse
No announcement yet.

adding links to images in a image rotating script - help needed.

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

  • adding links to images in a image rotating script - help needed.

    Hi,
    I have a very simple script which rotates seven images in random order. So I would like all of these images to be linked to my index page, which should open in the same window. Here is my script, I tried adding all sorts of code and ended up with very interesting results - document.open.window got me with a thousand windows opening, and I also ended up with redirecting stuff, and lots of useless things. Please help and many thanks in advance.


    <SCRIPT LANGUAGE="JAVASCRIPT">
    var img_rnd = new Array ("image1", "image2");
    var i = Math.round(6*Math.random());
    document.write('<IMG SRC="' + img_rnd[i] + '" WIDTH="777" HEIGHT="280">');
    </SCRIPT>

  • #2
    document.write('<a href="MAINPAGE.HTML"><IMG SRC="' + img_rnd[i] + '" WIDTH="777" HEIGHT="280"><\/a>');

    Comment


    • #3
      Hi,
      thanks a lot - I should've thought of that. I managed to fix the border though.

      Comment

      Working...
      X