Changing the banner image of website

Asked By 0 points N/A Posted on -
qa-featured

Hi Guys,

I have 5 jpg banner images of same height and width and I want the banner of my website should change every time the page loads.

How can I make this? 

SHARE
Answered By 0 points N/A #120772

Changing the banner image of website

qa-featured

Hi Richard,

That’s a easy process to make slide show for banner in a website. You should have just a little bit HTML basic coding knowledge for do that. Please follow the bellows instructions for make image slide show without using any SWF or flash file.

At first open my attached text file. And then add your image url where I write “PUT YOUR IMAGE URL HERE”. There have three image source. You should create more two source for make slideshow with five picture. You can change image delay time by change.

//call function "slideit()" every 2.5 seconds

setTimeout("slideit()",2500)

You can increase or decrease value for make faster or slower slideshow.

After complete editing you should place this script at the header of website.

Thanks.

Answered By 566810 points N/A #120774

Changing the banner image of website

qa-featured

If you want to change the banner on a page every time it loads and select randomly among five JPG banner images, here’s a JavaScript which I created and used on my site before. Just add it to your JS file and call it on your HTML page where you want to display the banner.

function bannerHTML(){
  var banner=new Array()
    banner[1]="image URL"
    banner[2]="image URL"
    banner[3]="image URL"
    banner[4]="image URL"
    banner[5]="image URL"

  var jun=Math.floor(Math.random()*banner.length)
    if (jun==0)
    jun=1

document.write(' <img src= '+'"'+banner[jun]+ '"'+' alt='+'"'+alternate text+'"'+'>')
}

To call it on your HTML page, insert this code to where you want your banner to appear.

<script type="text/javascript">bannerHTML()</script>

Login/Register to Answer

Related Questions