logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 06-11-2009, 12:27 AM   #1
kcmartz
kcmartz's Avatar
 
Join Date: Jun 2009
Location: DREAMWEAVER CS3
Posts: 26
Default Is there a way to...

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
kcmartz is offline   Reply With Quote
Old 06-11-2009, 12:42 AM   #2
MagicPower
 
Join Date: Jun 2009
Posts: 120
Default

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.
MagicPower is offline   Reply With Quote
Old 06-11-2009, 01:17 AM   #3
kcmartz
kcmartz's Avatar
 
Join Date: Jun 2009
Location: DREAMWEAVER CS3
Posts: 26
Default

what would the code be to make this happen?

anyone?
kcmartz is offline   Reply With Quote
Old 06-11-2009, 03:49 AM   #4
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Quote:
Originally Posted by MagicPower View Post
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.
Quote:
Originally Posted by kcmartz View Post
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
domedia is offline   Reply With Quote
Old 06-11-2009, 03:55 AM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

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
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 06-11-2009, 04:43 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

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
Code:
<!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>
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 06-12-2009, 02:25 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

here are my thought/complaints; time wasters are boring
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 06-13-2009, 12:23 AM   #8
kcmartz
kcmartz's Avatar
 
Join Date: Jun 2009
Location: DREAMWEAVER CS3
Posts: 26
Default

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

Last edited by kcmartz; 06-13-2009 at 12:29 AM..
kcmartz is offline   Reply With Quote
Old 06-26-2009, 07:07 PM   #9
kremo5le
kremo5le's Avatar
 
Join Date: Nov 2008
Location: San Diego, California
Posts: 112
Cool PHP and CSS

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.
kremo5le is offline   Reply With Quote
Old 07-02-2009, 02:19 AM   #10
Ranana_Etex
Ranana_Etex's Avatar
 
Join Date: Jun 2009
Location: Israel
Posts: 8
Default Is there a way to

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??
Ranana_Etex is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com