- This topic is empty.
-
AuthorPosts
-
March 23, 2011 at 10:58 am #32098aksaundersParticipant
can someone assist me by modifying the below code to change CSS styles for the holidays. Ideally, I would be able to set the duration the alternate style sheet would be used. For example, St. Patrick’s Day would be used for a week and Christmas would be used for a full month. Snippet from your snippet section is below. Thanks for any help you can provide.
March 23, 2011 at 10:59 am #54422aksaundersParticipant
March 23, 2011 at 12:33 pm #54429aksaundersParticipantYes, this is similar to what I would like to do. Instead of changing it by time of day though, I would like to change it by date. For example, I want to change the style sheet on April 18th to easter.css. It should change back to default.css on April 25th. I would then just add additional statements for the other holidays. BTW, thanks for responding so quickly too.
March 23, 2011 at 11:41 pm #54297aksaundersParticipantWill this code work? If there is an error, can someone modify it for me as I am very green at javascript? Thanks.
March 24, 2011 at 10:46 am #54092Rob MacKayParticipantIs there any reason you can’t use PHP?
Changing the CSS file I don’t think will work like that for the simple reason that the page has already loaded. You would be better off changing a single object by adding a class or ID.
March 24, 2011 at 11:27 am #54609TT_MarkMemberAs @Robskiwarrior says, changing the linked CSS with JavaScript will not work. It needs to be done before pageload with PHP or by appending a new class to specific elements on the page and having them targeted in the default.css
March 24, 2011 at 11:43 am #54093aksaundersParticipantThe hosting company that I use supports PHP. I don’t know anything about PHP and that is the only reason I am not using it. The only things that change with the different style sheets is the tiled background (each is holiday themed) and the background image for the header and footer which are colored to go with the tiled background. Can you show some sample code on how to assign new class to container element for example as this holds my tiled image? Appreciate the feedback too. Thanks.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.