Simple url rotator

Hello,
I’m looking for a simple url rotator that will work on IE.
No links or tracking are needed, only set of time interval, and url’s that will loop according to a list of sites I’ll enter.
Thanks

Hello zurdoron,

There is one useful plugin “jQuery Cycle Plugin” which might help you. By using this plugin you can move your text (left, right, up, down, fading effect) with the time delay in between. Just search for it and check the effect it provides.

I’m sorry if I didn’t explain myself correctly. What I’m looking for is a url rotator that will display a complete page each time.
Thanks

Hi there,

Just out of interest, could you explain a little more what you mean.
The closest thing I could imagine to this:

which would be implementable in JavaScript, would be to cycle through a list of URLs and display them one after another in an iFrame.
Is this anything like what you are trying to do?

Thanks for your reply. Yes, I want to cycle through a list of URLs and display them one after the other in an IFrame, or if you think of an other simple solution to cycle these URLs - it will be fine. I want to load the page and let the script cycle through a list of urls I’ll define.

Hi there,

Although looping through an array and setting an iframe’s src attribute accordingly sounds easy, there is still quite a lot to consider here.
For example what should happen if the iframe doesn’t load properly?

I’ve made a simple demo of how this could work.

Here’s the code. I hope this gives you a good starting point.

<!DOCTYPE HTML>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>URL Cycler</title>
    <style>button{display: block;}</style>
  </head>

  <body>
    <h1>Now displaying: <span id="url">Nothing</span></h1>
    <iframe id="frame" src="" width="300" height="300"></iframe>
    <button id="cycle">Cycle</button>

    <script type="text/javascript">
      var urlArray = ['http://www.sitepoint.com','http://bbc.co.uk','http://www.hibbard.eu'];
      var count = -1;
      var i = document.getElementById('frame');
      var c = document.getElementById('cycle');
      var u = document.getElementById('url');

      function nextUrl() {
        url = urlArray[++count];
        count = (count >= urlArray.length - 1)? -1 : count;
        return url;
      }

      c.onclick = function(){
        c.disabled = true;
        u.innerHTML = '';
        i.src = nextUrl();
        i.onload = function(){
          u.innerHTML = i.src;
          c.disabled = false;
        }
      }
    </script>
  </body>
</html>