Advanced Search

Results 1 to 2 of 2

Thread: rotation of content based on time and day

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default rotation of content based on time and day

    I am trying to get two different sets of content to display on a webpage based on time and day. I am using the following code and can't seem to get it to work. Any suggestions would be welcome.

    Thank you.

    Code:
    <!-- Script for Rotation of Library Help and Qwidget -->
    
    <script type="text/javascript">
     
    var checkTime = new Date();
    var hours = checkTime.getHours();
    var day = checkTime.getDay();
      
    if (day == 0) 
    	{
        document.getElementById("libraryhelp").style.display = 'none';
        document.getElementById("qpchatwidget").style.display = '';
    	}
    else if ((day > 1 && day < 5) && (hours < 9 && hours > 21)) 
    	{
        document.getElementById("qpchatwidget").style.display = 'none';
        document.getElementById("libraryhelp").style.display = '';
    	}
    else if ((day == 5) && (hours < 9 && hours > 17)) 
    	{
    	document.getElementById("libraryhelp").style.display = 'none';
        document.getElementById("qpchatwidget").style.display = '';
    	}
    else if ((day == 6) && (hours < 10 && hours > 16)) 
    	{
        document.getElementById("libraryhelp").style.display = 'none';
        document.getElementById("qpchatwidget").style.display = '';
    	}
    else {
        document.getElementById("qpchatwidget").style.display = '';
        document.getElementById("libraryhelp").style.display = 'none';
    	}
    
    </script>
    
    <!-- Beginning of LibraryH3lp code. -->
    <div id="libraryhelp" style="display: none;">
    <iframe src="http://libraryh3lp.com/chat/lccask-a-librarian@chat.libraryh3lp.com?skin=8804&amp;theme=simpletext&amp;title=Ask+a+Librarian&amp;identity=Librarian" frameborder="1" style="width: 230px; height: 350px; margin-left: 8px; border: 2px solid #344152;"></iframe>
    </div>
    
    <!-- Beginning of Qwidget code. -->
    <div id="qpchatwidget"></div>
    <script id="qp.bootstrap" type="text/javascript" src="http://www.questionpoint.org/crs/js/qwidget/qp.bootstrap.js?langcode=1&instid=12754&skin=gray" charset="utf-8">//<noscript>Please enable javascript to chat with librarians online</noscript></script>
    </div>

  2. #2
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    try jquery
    jquery.jwplayer.js : http://developer.longtailvideo.com/t...er.js?rev=1021

    Code:
    <html>
    <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.jwplayer.js"></script>
    </head>
    <body>
    <div style=" -webkit-transform: rotate(-3deg); -moz-transform: rotate(-3deg);">
    <p>some content here.</p>
    </div>
    </body>
    </html>

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
  •