PDA

View Full Version : Is there a way to...


kcmartz
06-11-2009, 12:27 AM
to have multiple stylesheets and have a new one automaticlly change on a day, week, month, year, or special event basis?

thanks for your help

--kcmartz

MagicPower
06-11-2009, 12:42 AM
it's you that creates the stylesheet and it's you that changes it and it automatically updates itself but if you don't "save all" you lose everything. CSS is what you mean - new css rule then rule definition, from the drop down menu select New Style Sheet File. you can do as many of those as you want. hope dis helps.

kcmartz
06-11-2009, 01:17 AM
what would the code be to make this happen?

anyone?

domedia
06-11-2009, 03:49 AM
it's you that creates the stylesheet and it's you that changes it and it automatically updates itself but if you don't "save all" you lose everything. I think you misunderstood the question Magic. kcmartz's looking for an automated solution.
what would the code be to make this happen? I can't write the code for you unfortunately. You can do this server side or client side. Client side you have to depend on JS, so writing a script on the server that checks for the date and serve the appropriate stylesheet is maybe your best bet. Just a list if IF statements. Someone is going to arrest me now and tell me I should not give stupid advice on server side stuff 8)

edbr
06-11-2009, 03:55 AM
i am fairly sure you will find a javascript that will do this, i seem to remember a script on this forum to determine day/night, if is that might get you started

edbr
06-11-2009, 04:43 AM
found it , originally posted by Pete. You need to look up getDay()

but you see the conditions return classes so it could be adapted yto your needs

some thing like

change the get hours to days and (i think) if(d==1) etc etc
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
<head>
<title>demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript">
var timeScript = {
hour:new Date().getHours(),
getHour:function(){
return this.hour;
},
showImage:function(){
var h = this.getHour();
if(h>=13 && h<=17){
document.getElementById('t').className = 'afternoon';
} else if(h>=9 && h<=12){
document.getElementById('t').className = 'morning';
}
}
}
window.onload = function(){
timeScript.showImage();
}
</script>

<style type="text/css">
<!--
body {
font-family:arial,verdana, sans-serif;
}
#t {
margin:20px auto 20px auto;
width:350px;
height:200px;
}
.afternoon {
background-image:url(afternoon.jpg);
}
.morning {
background-image:url(morning.jpg);
}
-->
</style>
</head>
<body>
<div id="t"></div>
</body>
</html>

edbr
06-12-2009, 02:25 AM
here are my thought/complaints; time wasters are boring

kcmartz
06-13-2009, 12:23 AM
[quote=edbr;161293]found it , originally posted by Pete. You need to look up getDay()

but you see the conditions return classes so it could be adapted yto your needs

some thing like

change the get hours to days and (i think) if(d==1) etc etc


Thanks edbr, will try that!

EDIT:
were there images at all? it didn't do anything!

kremo5le
06-26-2009, 07:07 PM
I'm not an expert coder, yet I have seen on several of my projects PHP combined with CSS. So, to your question I believe you can indeed make that happen if you are to set certain months or holidays. I would personally just do the changes by hand; less work, same results.

Ranana_Etex
07-02-2009, 02:19 AM
We have clouds today--I still havent heard if snow is on its way or not. They said it was suppose to snow last night and we didnt get anything??

kremo5le
07-02-2009, 05:04 AM
We have clouds today--I still havent heard if snow is on its way or not. They said it was suppose to snow last night and we didnt get anything??

May I ask, what this is? :confused:

Corrosive
07-02-2009, 06:12 AM
May I ask, what this is? :confused:

It is bizarre spam with no links or purpose. We get a bit of that...can't really find a reason to delete it though...no herbal viagra or jordan shoes!

kremo5le
07-02-2009, 06:14 AM
It is bizarre spam with no links or purpose. We get a bit of that...can't really find a reason to delete it though...no herbal viagra or jordan shoes!

Are you telling me the truth? This is insane! But, you are right about not having a reason to delete it. Sounded good and everything...

;-)

Corrosive
07-02-2009, 06:33 AM
Are you telling me the truth?

Of course...! These posts crop up from time to time. They have no relevance to the topic and look like they are copied from another forum thread. Very odd. One day we'll work out why they do it...until then it will sit there.

kremo5le
07-02-2009, 07:14 PM
Of course...! These posts crop up from time to time. They have no relevance to the topic and look like they are copied from another forum thread. Very odd. One day we'll work out why they do it...until then it will sit there.

I'm laughing just thinking about it! Yes, I'm sure you can just restrict IP addresses and stuff like that for the future. :mrgreen:

domedia
07-02-2009, 09:56 PM
For the rest of us that has subscribed to this thread, this is very off topic :)