The Student Room Group

HTML Code help!!!! URGENT!!!!!!

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.scrollWidth,0);}
//done
// -->
</script>
</body>
</html>
Can you also upload the style.css file.
@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.
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?
Original post by freddie.erg
Stack Overflow?


Yeah, that's the one. I used it and it helped. :smile:

Quick Reply

Latest

Trending

Trending