ok, so I finally got round to making a more accessible version of our website (high contrast, larger fonts etc). So there I am, bits of java script messing around with a second css file, making a cookie so that the setting is stored and it all works wonderfully.
That is, in firefox. Not so good in IE. As far as I can tell the error is somewhere in here....
setDefault() works and returns you to the standard style sheetCode:var defaultSheet=document.getElementById('cahs'); var accessibleSheet=document.getElementById('hi'); accessibleSheet.disabled=true; function setHighvis(){ defaultSheet.disabled=true; accessibleSheet.disabled=false; } function setDefault(){ accessibleSheet.disabled=true; defaultSheet.disabled=false; }
setHighvis() only sort of works. It disables the default style but does not enable the high vis. But only for IE, it works fine in firefox. Anyone any ideas?
Code:<link href="/cahs.css" rel="stylesheet" type="text/css" Title="Default" id="cahs"/> <link href="/hi-vis.css" rel="alternative stylesheet" type="text/css" Title="High Visibility" id="hi"/>The cookies work fine, it saves and retrieves status ok. Its just the setting of the high vis sheet that doesn't work.Code:<a href="#" onclick="setDefault();document.cookie = 'highvis=false; expires=Thu, 2 Aug 2021 20:47:11 UTC; path=/';">Default</a> | <a href="#" onclick="setHighvis();document.cookie = 'highvis=true; expires=Thu, 2 Aug 2021 20:47:11 UTC; path=/';">High Visibility</a> |




Reply With Quote