Turn on thread page Beta
    • Thread Starter
    Offline

    0
    ReputationRep:
    can someone help me with making select images in my array load from the bottom of the page,
    i have searched online and it seems that i have the right code but its just not working.

    i'm using dreamweaver if that helps

    here is my code;

    <!doctype html>
    <html>
    <head>
    <link href="style.css" rel="stylesheet" type="text/css">
    </head>


    <body>




    <script>
    <!--//Random Banner image on Page Reload
    //store the images in arrays below

    images = new Array(10);

    images[0] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[1] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[2] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[3] = '<a href="http://www.example.com"><img" width="300%" height="150%" alt=""/></a>';

    images[4] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[5] = '<a href="http://www.example.com"><img" width="300%" height="150%" alt=""/></a>';

    images[6] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[7] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';


    images[8] = '<a href="http://www.example.com"><img" width="100%" height="100%" alt=""/></a>';

    images[9] = '<a href="http://www.example.com"><imgg" width="100%" height="100%" alt=""/></a>';


    index = Math.floor(Math.random() * images.length);
    //console.log(index);
    document.write(images[index]);
    if(images[index]==5){
    window.scrollTo(0,document.body. scrollHeight);}

    if(images[index]==7){
    window.scrollTo(document.body.sc rollWidth,0);}
    //done
    // -->
    </script>
    </body>
    </html>
    Offline

    1
    ReputationRep:
    Can you also upload the style.css file.
    Offline

    17
    ReputationRep:
    drowzee this brings back awful memories.

    I don't know OP but there is a really good forum you can ask on, but I have forgotten the name. Just search around the net and you will find it, it's well known in the programming world.
    Offline

    1
    ReputationRep:
    (Original post by TheonlyMrsHolmes)
    drowzee this brings back awful memories.

    I don't know OP but there is a really good forum you can ask on, but I have forgotten the name. Just search around the net and you will find it, it's well known in the programming world.
    Stack Overflow?
    Offline

    17
    ReputationRep:
    (Original post by freddie.erg)
    Stack Overflow?
    Yeah, that's the one. I used it and it helped.
 
 
 
Reply
Submit reply
Turn on thread page Beta
TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Updated: October 27, 2015
Poll
“Yanny” or “Laurel”

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.