Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2003
    Location
    mo
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript to rotate a iframe

    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

  • #2
    Regular Coder Vincent Puglia's Avatar
    Join Date
    Jul 2003
    Location
    where the World once stood
    Posts
    367
    Thanks
    0
    Thanked 13 Times in 13 Posts
    Hi,

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

    PHP Code:
    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
    Where the world once stood
    the blades of grass
    cut me still


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •