Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random Image Script - adaptations

    Hi,

    I have just found the Random Image Script which seems great.

    What I was wondering was if it was possible to add further bits to it (either in the script or via css, not sure how)

    1. I would like to be able to add an 'alt' tag to the images, so whilst on the webpage and the user hovers over the picture, the title appears.

    2. Where the user clicks on the photo and it takes them to a webpage, can this be to a new window, so basically, target_blank?

    Many thanks in advance

    Beth

  • #2
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry, meant to give the link;

    http://www.javascriptkit.com/script/cut118.shtml

    The code is:<script language="JavaScript">
    <!--

    /*
    Random Image Script- By JavaScript Kit (http://www.javascriptkit.com)
    Over 400+ free JavaScripts here!
    Keep this notice intact please
    */

    function random_imglink(){
    var myimages=new Array()
    //specify random images below. You can have as many as you wish
    myimages[1]="image1.gif"
    myimages[2]="image2.gif"
    myimages[3]="image3.gif"
    myimages[4]="image4.gif"
    myimages[5]="image5.gif"
    myimages[6]="image6.gif"

    //specify corresponding links below
    var imagelinks=new Array()
    imagelinks[1]="http://www.javascriptkit.com/script/cut118.shtml"
    imagelinks[2]="http://www.javascriptkit.com/script/cut118.shtml"
    imagelinks[3]="http://www.javascriptkit.com/script/cut118.shtml"
    imagelinks[4]="http://www.javascriptkit.com/script/cut118.shtml"
    imagelinks[5]="http://www.javascriptkit.com/script/cut118.shtml"


    var ry=Math.floor(Math.random()*myimages.length)
    if (ry==0)
    ry=1
    document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
    }
    random_imglink()//-->
    </script>

    <p align="center">This free script provided by<br />
    <a href="http://javascriptkit.com">JavaScript
    Kit</a></p>
    Last edited by Bethlou; 10-21-2010 at 10:51 PM.


  •  

    Tags for this Thread

    Posting Permissions

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