Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS change for holidays

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #32098
    aksaunders
    Participant

    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.

    #54422
    aksaunders
    Participant


    #54429
    aksaunders
    Participant

    Yes, 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.

    #54297
    aksaunders
    Participant

    Will this code work? If there is an error, can someone modify it for me as I am very green at javascript? Thanks.



    #54092
    Rob MacKay
    Participant

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

    #54609
    TT_Mark
    Member

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

    #54093
    aksaunders
    Participant

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.