is it possible to put a link to my rotating backround image?
below is the exact JS script
What do i need to do to put a link to the each images
and the link changes every time it changes also.
-----------------------------------------------
Code:
var s5_current_gc_bg = 1;
var s5imgdiv = "s5_body_wrap";
window.addEvent('domready', function(){
s5_display_time();
});
function s5_display_time() {
window.setTimeout('s5_load_fade_out()',(s5_bg_tween*1000));
}
function s5_load_fade_out() {
$(s5imgdiv).fx = $(s5imgdiv).effect('opacity', {duration: 800}).start(0);
window.setTimeout('s5_change_img()',900);
}
function s5_load_fade_in() {
$(s5imgdiv).fx = $(s5imgdiv).effect('opacity', {duration: 800}).start(1);
window.setTimeout('s5_display_time()',(s5_bg_tween*1000));
}
function s5_change_img() {
if (s5_current_gc_bg == "1") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_2 + ")";
s5_current_gc_bg = 2;
}
else if (s5_current_gc_bg == "2") {
if (s5_bg_images == "2") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_1 + ")";
s5_current_gc_bg = 1;
}
if (s5_bg_images > "2") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_3 + ")";
s5_current_gc_bg = 3;
}
}
else if (s5_current_gc_bg == "3") {
if (s5_bg_images == "3") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_1 + ")";
s5_current_gc_bg = 1;
}
if (s5_bg_images > "3") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_4 + ")";
s5_current_gc_bg = 4;
}
}
else if (s5_current_gc_bg == "4") {
if (s5_bg_images == "4") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_1 + ")";
s5_current_gc_bg = 1;
}
if (s5_bg_images > "4") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_5 + ")";
s5_current_gc_bg = 5;
}
}
else if (s5_current_gc_bg == "5") {
if (s5_bg_images == "5") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_1 + ")";
s5_current_gc_bg = 1;
}
if (s5_bg_images > "5") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_6 + ")";
s5_current_gc_bg = 6;
}
}
else if (s5_current_gc_bg == "6") {
if (s5_bg_images == "6") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_1 + ")";
s5_current_gc_bg = 1;
}
if (s5_bg_images > "6") {
document.getElementById("s5_body_wrap").style.backgroundImage = "url(" + s5_bg_img_7 + ")";
s5_current_gc_bg = 7;
}
}
s5_load_fade_in();
}
----------------------------------------
Last edited by chrishirst; 12-11-2010 at 06:13 PM..
|