You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1009 B
JavaScript
29 lines
1009 B
JavaScript
6 years ago
|
// Banner Switch for Homepage
|
||
|
$(function(){
|
||
|
showImage();
|
||
|
});
|
||
|
<!-- Begin Random Logo In Header Script
|
||
|
|
||
|
var theImages = new Array() // do not change this
|
||
|
|
||
|
<!-- Edit the url images to match yours
|
||
|
theImages[0] = '/css/images/banner/banner-5.GIF'
|
||
|
theImages[1] = '/css/images/banner/china-tours/china-panda-tours.gif'
|
||
|
theImages[2] = '/css/images/banner/china-tours/tibet-impression.gif'
|
||
|
theImages[3] = '/css/images/banner/china-tours/index.gif'
|
||
|
theImages[4] = '/css/images/banner/china-tours/minority-discovery.gif'
|
||
|
|
||
|
|
||
|
var j = 0
|
||
|
var p = theImages.length;
|
||
|
var preBuffer = new Array()
|
||
|
for (i = 0; i < p; i++){
|
||
|
preBuffer[i] = new Image()
|
||
|
preBuffer[i].src = theImages[i]
|
||
|
}
|
||
|
var whichImage = Math.round(Math.random()*(p-1));
|
||
|
function showImage(){
|
||
|
$("#wrapper").css("background","url('"+theImages[whichImage]+"') no-repeat")
|
||
|
//document.write('<a href="//www.chinahighlights.com/hotel/canton-fair/"><img src="'+theImages[whichImage]+'" border="0" alt="Discount China Hotel" title="Discount China Hotel"/></a>');
|
||
|
}
|