SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Different stylesheet for NS?
-
Jul 31, 2001, 08:19 #1
- Join Date
- May 2001
- Location
- Los Angeles
- Posts
- 22
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Different stylesheet for NS?
I'm interested in learning how to provide an alternate stylesheet for my NS 4.x vistitors so I get a "somewhat" desired look and feel for both IE and NS.
Can someone point me in the direction of a browser "sniffer" script and how I would input my changing stylesheet into the script?
solalmightysolalmighty
More Qs than As.
-
Jul 31, 2001, 15:14 #2
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Aug 2, 2001, 05:08 #3
- Join Date
- Aug 2000
- Location
- Thailand
- Posts
- 4,810
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Good link
That's a good link you brief bugger!
~The Artist Latterly Known as Crazy Hamster~
922ee590a26bd62eb9b33cf2877a00df
Currently delving into Django, GIT & CentOS
-
Aug 2, 2001, 10:12 #4
- Join Date
- Jul 2000
- Location
- Here
- Posts
- 1,010
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Alternatively, you could use server-side scripting to check the browser then output the stylesheet based off of that. You wouldn't even be able to tell that there were 2 versions.
-
Aug 2, 2001, 10:39 #5
- Join Date
- Jun 2001
- Location
- Oklahoma
- Posts
- 3,392
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I agree with Wes. If you have access to server-side scripting languages, I would go with his suggestion.
Colin Anderson
Ambition is a poor excuse for those without
sense enough to be lazy.
-
Aug 5, 2001, 11:27 #6
- Join Date
- Sep 2000
- Posts
- 230
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's the script i've created to do what you need..this is on the client instead of the server though.
Plus..this sniffs for Browser and Platform version..thus applying 5 different sheets:
IE - PC & Mac
NS - PC & Mac
and a default script for all other browsers...
--------------------------------------------------------------------
var ua = 0;
var bd = 0;
var ss_dir = '../stylesheets/';
// can we get browser & os info?
if(navigator.userAgent)
ua = navigator.userAgent.toLowerCase();
if(navigator.appName)
bd = navigator.appName.toLowerCase();
// if yes,
if(ua){
document.write("\n");
// if M$ os,
if((ua.indexOf("win")!=-1)||(ua.indexOf("windows")!=-1)){
if(bd.indexOf("netscape")!=-1)
document.write('<link rel="stylesheet" type="text/css" href="'+ss_dir+'ms_ns.css">');
else if(bd.indexOf("microsoft")!=-1)
document.write('<link rel="stylesheet" type="text/css" href="'+ss_dir+'ms_msie.css">');
// if mac os,
} else if((ua.indexOf("mac")!=-1)||(ua.indexOf("ppc")!=-1)){
if(bd.indexOf("netscape")!=-1)
document.write('<link rel="stylesheet" type="text/css" href="'+ss_dir+'mac_ns.css">');
else if(bd.indexOf("microsoft")!=-1)
document.write('<link rel="stylesheet" type="text/css" href="'+ss_dir+'mac_msie.css">');
}
document.write("\n");
// if no,
} else {
document.write('<link rel="stylesheet" type="text/css" href="'+ss_dir+'default.css">');
document.write("\n");
}
----------------------------------------------------------------------
Bookmarks