I need to ask a Javascript question: NS Specific - CSS Sheets 
Author Message
 I need to ask a Javascript question: NS Specific - CSS Sheets

I'm sorry guys, I really am. I've tried posting this in Netscape and
Javascript specific groups, but they get as much traffic as their browser
does use; about 5% of this place.

And lots of spam.

So, I wanted to throw this out to you guys, because you really do know what
you're talking about.

The other day I asked about dynamically changing the entire CSS src through
client-sode code. Evertjan kindly posted:

Quote:
>> document.all.tags("link")[0].href = "my.css";
>> document.all.tags("link")[0].disabled = "";

This obviously doesn't work in Netscape and the only way I could emulate it
was by giving the link tag an id, referencing this through getElementById()
and then changing the href. Whilst this 'worked', it was extremely
problematic: The styles & page would jump and jerk as it unloaded the
previous CSS - brief pause - and then loaded the next CSS. At times it would
load one sheet, but would never fire again. At other times it would load
part of the new sheet, but not all, and those parts that didn't load would
never load regardless of the new sheet that was loaded in (in other words,
if the style for links wasn't loaded, it would be dropped from all
subsequent style changes, like it has become stuck).

Now this may be a bug within Netscape 7.0, or simply poor/no support for
this sort of use, but perhaps there is another way???

In NS6/7 can the referenced style sheet be completely changed, client-side?
Is there an optinmum way of doing this, or will the user be forever
subjected to the jumping & jerking behavior as it switches? Shall I simply
detect for NS and reload the page with the new style instead?

BTW, I've tried diligently searching for solutions on the 'net, but whilst I
can find plenty of references to changing individual styles or class, I can
find nothing for changing the entire style sheet. Any guidance - even a "it
cannot be done", is appreciated.



Sat, 07 May 2005 21:29:56 GMT  
 I need to ask a Javascript question: NS Specific - CSS Sheets
There's a couple of articles on ALA that might be what you're looking for.
Take a look at these...

This works in all browsers v5 and above and Mozilla
http://www.alistapart.com/stories/alternate/

This is supposed to work in NN4 but I haven't tried it
http://www.alistapart.com/stories/n4switch/

--

Dave



Sat, 07 May 2005 23:50:19 GMT  
 I need to ask a Javascript question: NS Specific - CSS Sheets

Quote:
>> This works in all browsers v5 and above and Mozilla
>> http://www.*-*-*.com/

This is the sort of thing I was looking for Dave, thanks. It seems somewhat
more complex and cumbersome than my 2 lines, but if it's more compatible
across the browsers, then I'm all for it. :)

Quote:
>> This is supposed to work in NN4 but I haven't tried it
>> http://www.*-*-*.com/

Whilst initially e{*filter*}d at the prospect of this, i see that it 'cheats'
slightly and doesn't *really* offer a dynamic way to switch ... not without
a reload, anyway. I have the luxury of .asp which can reset the style on a
reload, so it may just have to be the way of things for those earlier
browsers.

NN4 ... why? Why would someone still use that? Heathens.

Thanks again Dave ... that was a great link :)



Sun, 08 May 2005 00:06:15 GMT  
 I need to ask a Javascript question: NS Specific - CSS Sheets
You're welcome. Glad I could help.

While I agree with you in re NN4, there are still corporations and institutions that have standardized on NN4 and (for whatever reason) refuse to upgrade. Good news is that the number is shrinking... ;)

--

Dave



Sun, 08 May 2005 01:44:03 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. CSS/JavaScript question (IE4 explicit)

2. FREE Tutorials on HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript, SAP - ABAP

3. make LaserWriter ask for single sheet?

4. Need E-Mail Address to Microsoft or Newsgroup I can ask Sales Question

5. open a specific sheet

6. Newbies: If you are asking for help, make your subject line specific

7. Newsgroup dedicated to NS vs IE javascript?

8. Javascript Scroller for IE & NS

9. NS Resize and Javascript

10. Signed JavaScript in NS= (?????) Script in IE

11. problems with JavaScript, CSS, and IE5

12. Javascript-CSS

 

 
Powered by phpBB® Forum Software