Hi
I'm setting up a random script to select from 5 different images, and they each have their own url they will link to when clicked. This works fine. The problem I'm having is when clicking on these random images when they load, having the url they link to be in a popup sized window. I know about onclick events, etc, but tieing all these things together is what's screwing me up. Any help would be appreciated. Thanks.
Here's my code so far.
<script language="JavaScript">
<!-- Hide from old browsers
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/airmax.jpg"
images[2] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/ezblade.jpg"
images[3] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/esav.jpg"
images[4] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/wobble.jpg"
images[5] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/ezglass.jpg"
var image = images[rand1]
links = new Array
links[1] = "http://10.1.1.168/Hunter/consumerSite/features/airmax.php"
links[2] = "http://10.1.1.168/Hunter/consumerSite/features/ez-blades.php"
links[3] = "http://10.1.1.168/Hunter/consumerSite/features/energysav.php"
links[4] = "http://10.1.1.168/Hunter/consumerSite/features/wobblefree.php"
links[5] = "http://10.1.1.168/Hunter/consumerSite/features/ez-glass.php"
var link = links[rand1]// -- End Hiding Here -->
</script>
<script language="JavaScript">
<!-- Hide this script from old browsers -->
document.write('<A HREF=http://www.webdeveloper.com/forum/archive/index.php/"' + link + '"><IMG SRC=http://www.webdeveloper.com/forum/archive/index.php/"' + image + '" border="0"></a>')
<!-- End Hiding Here -->
</script>
I'm setting up a random script to select from 5 different images, and they each have their own url they will link to when clicked. This works fine. The problem I'm having is when clicking on these random images when they load, having the url they link to be in a popup sized window. I know about onclick events, etc, but tieing all these things together is what's screwing me up. Any help would be appreciated. Thanks.
Here's my code so far.
<script language="JavaScript">
<!-- Hide from old browsers
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/airmax.jpg"
images[2] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/ezblade.jpg"
images[3] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/esav.jpg"
images[4] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/wobble.jpg"
images[5] = "http://10.1.1.168/Hunter/consumerSite/media/home/teasers/ezglass.jpg"
var image = images[rand1]
links = new Array
links[1] = "http://10.1.1.168/Hunter/consumerSite/features/airmax.php"
links[2] = "http://10.1.1.168/Hunter/consumerSite/features/ez-blades.php"
links[3] = "http://10.1.1.168/Hunter/consumerSite/features/energysav.php"
links[4] = "http://10.1.1.168/Hunter/consumerSite/features/wobblefree.php"
links[5] = "http://10.1.1.168/Hunter/consumerSite/features/ez-glass.php"
var link = links[rand1]// -- End Hiding Here -->
</script>
<script language="JavaScript">
<!-- Hide this script from old browsers -->
document.write('<A HREF=http://www.webdeveloper.com/forum/archive/index.php/"' + link + '"><IMG SRC=http://www.webdeveloper.com/forum/archive/index.php/"' + image + '" border="0"></a>')
<!-- End Hiding Here -->
</script>