Hi, I'm using a script which changes the background acording to the time, it works fine, but it breaks my css because it is loaded from the body. Is there a way I can load it from the div?
Here is the js
And here is the line that loads the function
the function is
Just need to find a way to make it load on div, instead of the body, I tried to insert on the div, but didnt work.
Here is the js
Code:
// © copyright Sibran Lens
// Leave this comment if you want to use this script for your website
// http://blog.e-ss.be
function CSSTimeSwitch()
{
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour >= 20)
display = "evening";
else if (thehour >= 17)
display = "late-afternoon";
else if (thehour >= 13)
display = "afternoon";
else if (thehour >= 11)
display = "noon";
else if (thehour >= 7)
display = "morning";
else if (thehour >= 1)
display = "night";
else
display = "general";
var thebody = document.getElementById("page");
thebody.className= display;
}
And here is the line that loads the function
Code:
<body id="page" class="yoopage <?php echo $this->params->get('leftcolumn'); ?> <?php echo $this->params->get('rightcolumn'); ?> <?php echo $itemcolor; ?> <?php echo $blog; ?> <?php echo $yootools->getCurrentToolsColor(); ?>" onload="CSSTimeSwitch();">
the function is
Code:
onload="CSSTimeSwitch();"
Comment