SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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

  2. #2
    SitePoint Enthusiast
    Join Date
    May 2011
    Posts
    55
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    webpage rotator

    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


    Quote Originally Posted by jimmybrion View Post
    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.

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,055
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi there,

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

    Quote Originally Posted by zurdoron View Post
    What I'm looking for is a url rotator that will display a complete page each time.Thanks
    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?

  5. #5
    SitePoint Member
    Join Date
    Feb 2013
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what I meant

    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.

    Quote Originally Posted by Pullo View Post
    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?

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,055
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    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.

    HTML Code:
    <!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>


Tags for this Thread

Bookmarks

Posting Permissions

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