sfraise Posted April 29, 2010 Share Posted April 29, 2010 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> Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted April 30, 2010 Share Posted April 30, 2010 All you have to do is put the ones you want at the beginning and instead of setting currentpage=0; on if(currentpage >= pages.length) currentpage=0; set it to the index in pages() that is the first banner that is to be rotated continuously. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.