Jump to content

How to limit an object in simple iframe banner rotation to only be shown once


sfraise

Recommended Posts

I have a simple banner rotation in an iframe that rotates several ads.

What I need to do is have the ability to have some of the objects only load once in the rotation while allowing others to be loaded continuously. Is there a statement I can add to the script to do this? Perhaps I need to set up an array in order to add the extra arguments?

Here's how the script looks:

<iframe name="ad" id="rotate" src="about:blank" scrolling="no" framespacing="0" frameborder="0" marginwidth="1" marginheight="1" border="0" style="width:729px; height:91px"></iframe>
<script language="JavaScript" type="text/javascript"><!--
// Pages to rotate
var pages=new Array('http://www.oohya.net/ads/google.html', 'http://www.oohya.net/ads/amateurmatch.html', 'http://www.oohya.net/ads/adbrite.html');
var rint=5; // Rotation interval
var currentpage=-1;
function rotator(){
currentpage++;
if(currentpage >= pages.length) currentpage=0;
document.all.rotate.src=pages[currentpage];
setTimeout('rotator()', rint * 25000);
}
rotator();
//--></script>
</iframe>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.