/    Sign up×
Community /Pin to ProfileBookmark

Rotating Banner Problem

Hello. I have a rotating gif banner that I want the link to change for when it flips to a certain image. Basically, there are two images, one that stays up for 15 seconds and the other 5 seconds, but each image needs a new link.
I found this:
[url]http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_53.html[/url]

But I need separate timings for each link, not the same for all.
Thanks.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@bp_travisauthorApr 12.2008 — After searching some more, I came across this script. Its not exactly what I wanted, but closer. I can't get it to work with <a> tags though. Here is the original site: http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_70.html

Here is my modified version to attempt to work with <a> tags:
[CODE]<SCRIPT LANGUAGE="JavaScript">
// Link Wheel By The JavaScript Source http://javascript.internet.com
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
<!-- Begin
function makeArray(q){
for(i=1 ; i < q ; i++){this[i]=0}}
w=1;
howmanysites=2;
Sites = new makeArray(howmanysites);

Sites[1] = "http://www.ryanspet.com";
Sites[2] = "mailto:[email protected]";


function showSites() {
if (w > howmanysites) { w=1; };
var string=Sites[w] + "";
var split1=string.indexOf("~");
var split2=string.indexOf("|");
var url=string.substring(0,split1);
var name=string.substring(split1 + 1,split2);
var word=string.substring(split2 + 1,string.length);
document.here.href=url;
document.here.name=name;
w+=1;
window.setTimeout('showSites()',10000);
}
function visitSite() {
window.location=document.here.href;
}
// End -->
</SCRIPT>[/CODE]


[code=html]<table><tr><td align=center>
<a href="" name="here" onClick="visitSite()"> <img src="http://www.groomertogroomer.com/march2008/frames/ryans_ad.gif" /></a>
</td></tr></table>[/code]
×

Success!

Help @bp_travis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...