Sent by Adam Bell on 23 February 2002 16:04
> Link a style sheet:
> <link rel="stylesheet" href="v4sheet.css" type="text/css">
>
> Put this script in your <head> after the link:
>
> <script type="text/javascript">
> <!--
> function P7_StyleLoader(tS) { //v1.1 by PVII
> var tH='',tDoc='',tA='<LIN'+'K REL="stylesheet" HREF=',tB='
> TYPE="text/css">';
> if(document.getElementsByTagName){var
> bb=document.getElementsByTagName("LINK");
> if(bb) {for(var
> k=0;k<bb.length;k++){if(bb[k].rel.toLowerCase()=="stylesheet"){
> var h=bb[k].href,x=h.lastIndexOf("/");if(x>0){tH=h.substring(0,x+1);}
> bb[k].disabled=true;tDoc=tA+'"'+ tH + tS + '"' +tB;
> document.write(tDoc);break;}}}}
> }
> P7_StyleLoader('w3csheet.css');
> //-->
> </script>
Al,
Hey, this is pretty cool. But I'm not sure I'm doing it right. I just added
the script to my two CSS files: masterns.css and masterie.css (Gee, wonder
which one's which?) And it was fine in IE but when I went to Netscape 6 it
seemed to be reading the same stylesheet. In other words, the IE one. Both
are Mac browsers. Maybe I don't have it structured right. Here's how it
appears in the code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TEST</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="masterie.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)
location.reload();
}
MM_reloadPage(true);
// -->
<!--
function P7_StyleLoader(tS) { //v1.1 by PVII
var tH='',tDoc='',tA='<LIN'+'K REL="stylesheet" HREF=',tB='
TYPE="text/css">';
if(document.getElementsByTagName){var
bb=document.getElementsByTagName("LINK");
if(bb) {for(var
k=0;k<bb.length;k++){if(bb[k].rel.toLowerCase()=="stylesheet"){
var h=bb[k].href,x=h.lastIndexOf("/");if(x>0){tH=h.substring(0,x+1);}
bb[k].disabled=true;tDoc=tA+'"'+ tH + tS + '"' +tB;
document.write(tDoc);break;}}}}
}
P7_StyleLoader('masterns.css');
//-->
</script>
--
Adam Bell
[EMAIL-REMOVED]
http://www.datatv.com
--
Over 90% of all websites suck.
Isn't it about time you were part of the minority?