...

View Full Version : javascript to rotate a iframe



gary pepper
09-25-2003, 06:25 PM
I have a banner exchange that uses iframes.What i want to do is add the code to my traffic exchange surfbar at top of page.Problem is i cant find a rotator that will rotate the iframe in the top of surfbar.I have tryed to rewrite some rotators to do this but with no luck .Is there a rotator that i can write up to do this function EXAMPLE of <i frame> i need to rotate in page

<center><iframe align=top width=468 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src="http://www.pro-creators.com/probannerexchange/view.php?uid=1"> <ilayer align=top width=468 height=60 src="http://www.pro-creators.com/probannerexchange/view.php?uid=1"></ILAYER> </iframe</center>


or is there a way to make this code refresh it self

Vincent Puglia
09-25-2003, 10:16 PM
Hi,

here's something I was writing for someone else. You should be able to modify it for your banners



var myPages = new Array();
myPages[0] = "http://members.aol.com/grassblad"
myPages[1] = "http://www.webxpertz.net/forums"
var someNdx = 0;

function someFunc(ndx)
{
someNdx++;
if (ndx < myPages.length)
{
frames.myFrame.location = myPages[ndx];
setTimeout('someFunc(' + someNdx + ')', 10000);
}
else clearTimeout('someFunc()')

}
function init()
{
setTimeout('someFunc(' + someNdx + ')', 10000);
}
//-->
</script>
</head>
<body onload='init()'>
1) an array of page locations and a global index var:
2) a timeout that calls a function with the ndx
3) the function that changes the location and increments the index var, and calls itself:
<iframe name='myFrame' src="http://www.htmlForums.com"></frame>


Vinny



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum