Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Location
    Corby
    Posts
    5,512
    Tokens
    2,675
    Habbo
    cabbage (origins)

    Latest Awards:

    Default Need this scriptttt +rep

    Hey, basically I need a script that I can put on my site that displays a random image, and some text beneath it, that changes like, every 15 seconds or something, it's gonna be for a random room adverts.

    +Rep!
    no

  2. #2
    Join Date
    Jul 2008
    Location
    Leeds, UK
    Posts
    47
    Tokens
    0

    Default

    Code:
    <script type="text/javascript">
    var images = new Array();
    images[0]=new Array();
    images[0][0]="IMAGE URL HERE";
    images[0][1]="TEXT HERE";
    images[1]=new Array();
    images[1][0]="IMAGE URL HERE #2";
    images[1][1]="TEXT HERE #2";
    
    function randimage()
    {
        var randomnumber=Math.floor((images.length+1)*Math.random());
        document.getElementById('image').src = images[randomnumber][0];
        document.getElementById('text').innerHTML = images[randomnumber][1];
    }
    
    function startrand()
    {
        randimage();
        t=window.setInterval(randimage, "15000");
    }
    </script>
    <body onload="startrand()">
    <img src="IMAGE URL HERE" id="image" /><br />
    <div id="text"></div>
    </body>
    Just spent 15 minutes making that :8.
    There are probably better ways of doing it but thats one i've just done now.

  3. #3
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    http://www.designplace.org/scripts.php?page=1&c_id=13

    Google goes a long way.

    Simple add " <meta http-equiv="refresh" content="15"/> " to the top or bottom of the script.

  4. #4
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Simple add " <meta http-equiv="refresh" content="15"/> " to the top or bottom of the script.
    or in the correct area. >_>
    Hi, names James. I am a web developer.

  5. #5
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Protege View Post
    or in the correct area. >_>
    It works in any area, not every HTML document has to be strict xHTML. or in place HTML.

  6. #6
    Join Date
    Oct 2005
    Location
    Corby
    Posts
    5,512
    Tokens
    2,675
    Habbo
    cabbage (origins)

    Latest Awards:

    Default

    thanks delatroy +rep
    no

Posting Permissions

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