How to do CSS style changing in IE7 with java

Soldato
Joined
7 Mar 2005
Posts
19,445
Location
LU7
Doing a final year project and I had used a javascript style changer from a PDF book I bought which referenced the alistapart.com site.

Now I've found that whilst the javascript changer works in Opera and Firefox (I am aware of the View>Style option in Opera and View>Page Style in Firefox) it won't work in IE7 which is ironic as it was intended for IE7 users. So since it works in Opera and Firefox I don't understand the problem with IE7.

What I am currently planning to do is to remove the javascript code in my pages for the style changer and replace it with a link entitled "Alternate CSS information" that when clicked will load a page stating that the site has a default CSS style but also some alternative styles such as print and high contrast etc but to use them Opera or Firefox needs to be used.

I believe I can argue that since IE7 doesn't support changing styles through the menu and needs javascript and links that it isn't fully supportive of changing styles and that in all likelihood (and my opinion) most users who want to use alternate style sheets for reasons of sight issues etc so needing large text or high contrast style sheets will already be using a browser that allows for style changing through the menu such as Opera and Firefox.

Is there any other way of implementing the style changer in IE or should I just go with my reasoned argument above? :)
 
If there is a way yes. I tried the script on the alistapart site but it hasn't worked in IE. It works in Firefox/Opera so it must work on some level, just not IE's. :(

However if there isn't a way to do this I will have to explain the difficulties in getting IE to play ball. The site renders identically in Firefox/Opera/Internet Explorer 7 so I am safe in that respect. It's just this style changer I'm stuck on. If I can get it sorted, great. If not then I just have to make a decision not to use a style changer with IE and justify it.
 
If there is a way yes. I tried the script on the alistapart site but it hasn't worked in IE. It works in Firefox/Opera so it must work on some level, just not IE's. :(

However if there isn't a way to do this I will have to explain the difficulties in getting IE to play ball. The site renders identically in Firefox/Opera/Internet Explorer 7 so I am safe in that respect. It's just this style changer I'm stuck on. If I can get it sorted, great. If not then I just have to make a decision not to use a style changer with IE and justify it.

Ah yeah, I heard problems about ALAs JS switcher in IE7, does the switcher need to be clien-tside (JS) or can it be server-side? :)
 
Decided to remove the java code and just say site has alternative styles but needs Firefox or Opera to show them. The site works in IE7 and renders identically so that requirement is taken care of. The java style changer wasn't a requirement so I can put that in as something I would have done if it worked properly.

:)
 
Back
Top Bottom