Website designer 10 question

trnhockey wrote on 3/18/2015, 4:36 PM

Well, on the old forum one of the moderators gave me code so I could have rotating images appear upon each refresh of my webpage. This is the code ....

<script type="text/javascript">
//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="index_htm_files/header-670.jpg"
randomcontent[1]="index_htm_files/header-index.png"
randomcontent[2]="index_htm_files/header-j-DiMeh9.jpg"
randomcontent[3]="index_htm_files/header-s32772q.png"
randomcontent[4]="index_htm_files/header-unnamed.png"
//No need to edit after here
document.write('<img src="'+randomcontent[Math.floor(Math.random()*randomcontent.length)]+'" width="100%" height="100%"></img>')
</script>

It works well! Only, now I would like it to work so that you can press on the image and it will take you to a link or webpage. Can somebody tell me how I can edit this code so that it will work that way?

Thanks, Todd Nebel

Comments

johnebaker wrote on 3/19/2015, 7:57 AM

Hi

If you search the Internet you will find their are many Javascripts available for doing what you want such as this one

The second post down on the page linked to is an example what you are looking for.

HTH

John EB

Last changed by johnebaker on 3/19/2015, 7:57 AM, changed a total of 1 times.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 23H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.