/    Sign up×
Community /Pin to ProfileBookmark

Multiple banner ads on one page

hey folks,

i need help – i am just getting into it but as of now i know close to NOTHING about javascript!

i need to post multiple (4) rotating banner ads on the same page – problem is, i don’t know which variables to change to distinguish the different scripts from one another. here is the script i’m using. can someone show me how to make this work with 4 different scripts?

Thanks so much.


—-

<HEAD>
<META HTTP-EQUIV=”Content-Type” CONTENT=”text/html; charset=ISO-8859-1″>
<TITLE>HELP!</TITLE>
</HEAD>

<table>
<TR VALIGN=TOP ALIGN=LEFT>
<TD HEIGHT=85></TD>
<TD WIDTH=450>
<SCRIPT LANGUAGE=”JavaScript”><!–

Banner_imganz=3;var Banner_sctr=0;var Banner_halt=0;var Banner_rand=1;var Banner_timeout=2000;var Banner_isn=new Array();
if (document.images) {
for (i=0;i<Banner_imganz;i++) Banner_isn[i]=new Image();
Banner_isn[0].src=”/images/test_images/banner1.gif”;
Banner_isn[1].src=”/images/test_images/banner2.gif”;
Banner_isn[2].src=”/images/test_images/banner3.gif”;
} else {
Banner_isn[0]=”/images/test_images/banner1.gif”;
Banner_isn[1]=”/images/test_images/banner2.gif”;
Banner_isn[2]=”/images/test_images/banner3.gif”;
}
var Banner_durl=new Array();
Banner_durl[0]=”http://www.cyber.com“;
Banner_durl[1]=”http://www.cortex.com“;
Banner_durl[2]=”http://www.brentwood.com“;
function Banner_rotate(){
if (Banner_halt!=1){
if (Banner_rand==0) {Banner_sctr++;}
else {Banner_sctr=Math.floor(Math.random()*Banner_imganz);}
if (Banner_sctr>Banner_imganz-1) Banner_sctr=0;
if (document.images) {
document.Banner.src=Banner_isn[Banner_sctr].src;
} else {
document.Banner.src=Banner_isn[Banner_sctr];
}
setTimeout(“Banner_rotate()”,Banner_timeout);
}
}
function Banner_link(){
Banner_halt=1;
if (Banner_durl[Banner_sctr].length!=0) location.href=Banner_durl[Banner_sctr];
}
function Banner_status(){ parent.window.status=Banner_durl[Banner_sctr];}
// –></SCRIPT><!– ACC <IMG
ID=”PictureChanger5_101″ HEIGHT=85 WIDTH=450 SRC=”/images/test_images/banner1.gif” BORDER=0>
ACC –><A HREF=”#” onClick=”Banner_link();return false” onMouseover=”Banner_status();return true;” onMouseout=”parent.window.status=”;return true;”><SCRIPT LANGUAGE=”JavaScript”><!–
Banner_sctr=-1; if (Banner_rand==0) {Banner_sctr++;}
else {Banner_sctr=Math.floor(Math.random()*
Banner_imganz);}
if (document.images) {
document.write(‘<img src=”‘+Banner_isn[Banner_sctr].src+'” alt=”Banner” width=450 height=85 border=0 name=Banner></A>’);
} else {
document.write(‘<img src=”‘+Banner_isn[Banner_sctr]+'” alt=”Banner” width=450 height=85 border=0 name=Banner></A>’);
}
setTimeout(“Banner_rotate()”,Banner_timeout);// –></SCRIPT></TD>
</TR></table>

</BODY>
</HTML>

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @trios23 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...