PDA

View Full Version : rotation of content based on time and day



samballado
01-20-2011, 12:56 AM
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.


<!-- 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>

ggalan
01-20-2011, 03:33 PM
try jquery
jquery.jwplayer.js : http://developer.longtailvideo.com/trac/browser/trunk/html5/jquery.jwplayer.js?rev=1021



<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>