Results 1 to 5 of 5

Thread: Style Sheet Switcher (v1.0) - IE does not remember style

  1. #1
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Style Sheet Switcher (v1.0) - IE does not remember style

    Question about Style Sheet Switcher (v1.0)
    from: http://www.dynamicdrive.com/dynamici...etswitcher.htm

    I have this script working fine with Firefox.
    With IE 6 it works OK on my hard disk, but on the Web it does not remember style when refreshing a page or opening a new one:

    http://www.onecreation.com/synergy/index.html

    Help appreciated.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,885
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    works for me in IE6 actually- select a new style, refreshing the page retains that style. Could it be that your IE6 security settings is set to not accept cookies on the web?

    BTW, you may want to add the additional code needed to have the current selection automatically checked once a new style is selected as far as the correct radio button:

    Code:
    <script type="text/javascript">
    window.onload=function(){
    var formref=document.getElementById("switchform")
    indicateSelected(formref.choice)
    }
    </script>
    See the script page for more info.

  3. #3
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No, my cookie is updating promptly.
    Checked on two more computers, and style there also retains.
    No idea what is wrong with my IE.

    The script you posted is already in all my pages headers.
    Btw. DD page says:
    >consider moving the above script inside "styleswitch.js"

    If moving means copy/pasting at the end of styleswitch.js, it only disables the script completely.

  4. #4
    Join Date
    May 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Found why

    Hi,

    I have found why IE don't remember CSS Style on page relaunch.
    I Had the same problems.

    So ...
    in your CSS link does not use space caracter in style title but "_" or "-" and all is OK

    Not Good:
    <link rel="stylesheet" type="text/css" href="default.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="blue theme" href="user.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="brown theme" href="user2.css" />

    Good one:
    <link rel="stylesheet" type="text/css" href="default.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="blue-theme" href="user.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="brown-theme" href="user2.css" />

    Or this one too:
    <link rel="stylesheet" type="text/css" href="default.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="blue_theme" href="user.css" />
    <link rel="alternate stylesheet" type="text/css" media="screen" title="brown_theme" href="user2.css" />

    I think that's because in the cookie the style name is mentionned without any quote and space characters create confusion.

    MooCan

  5. #5
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh, good catch!

    I did not have that particular problem, since I used only one word as CSS name, like "blue" or "black", no spaces.

    But thanks, anyway, good to know.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •