Chris Lam

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromChris Lam
ToMe
SubjectSome problems with stylesheet maninpulation
Date5 June 04 09:48
Hi,

First of all thanks for taking the time to read this email.

I am trying to use your style switching script,
http://www.howtocreate.co.uk/tutorials/javascript/domcss, and I am
having some problems.

I have three stylesheets.  I can switch to one stylesheet, but when I try to
switch to the other sheets it doesnt seem to enable them.  And even the ones
that do work seem a bit finicky, as right now I cannot get any switching to
work.

I put alert() statements around your code to verify that it is entering the
block of code that calls ss[x].disabled = false;.

I can only think that there is something in my stylesheets that is doing it.
Is there any requirements for the stylesheets?  My three different
stylesheets may not be identical in what they define.  In other words there
might be some attributes of a class that are defined in one stylesheet and
not in the other.

Thanks for your help,
Chris
FromMe
ToChris Lam
SubjectRe: Some problems with stylesheet maninpulation
Date5 June 04 11:25
Chris,

There are no special requirements, although some people have pointed out
that Internet Explorer does not like to use any more than 30 stylesheets.

One person also said that Opera 7.22 does not like to use @import in
alternate stylesheets. However, I could not reproduce that problem in any
opera version.

Could you send me a URL of the page so that I can see for myself, I may be
able to help better that way.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromChris Lam
ToMe
SubjectRe: Some problems with stylesheet maninpulation
Date5 June 04 18:04
Hi Mark,

Thank you for the response.  I think it's just an internet explorer bug
because

1. It works perfectly in Netscape
2. The errors are random and not reproducible

Unfortunately I do not have a website up yet and am simply developing on my
machine at home.  I got around it by using the setAttribute function and
changing the 'href'.

Because my site is heavy, and I mean havy, in javascript I am making it
compatible for ie 6+, netscape 7, and opera 7 because earlier/other browsers
do not support some of the javascript features I use.

Thanks anyway,
Chris
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.