In my document I link a stylesheet
<link rel="stylesheet" type="text/css" href="MyStylesheet.css">
I also defined an alternate stylesheet:
<LINK rel="alternate stylesheet" type="text/css" href="AlternateStyleSheet.css"
TITLE="AlternateCSS">
With some JavaScript (included below) it is possible to switch to the alternate
layout. When the alternate stylesheet is selected, MSIE (5.5SP2) does not print
according the alternate stylesheet.
Does anyone have a clue how to get MSIE to print according the choosen
(alternate) stylesheet?
Please respond: would be *very* much appreciated.
propje10 @ hotmail . com
---
<SCRIPT type="text/javascript">
/* altstyle.js : Steve Fulton : 1999.11.22
*
* Select alternate stylesheets. Adds a select dropdown to pick which style
* to apply to document. Document is loaded with persistent and default
* style sheets applied. Selector disables default (but not persistent)
* style sheets and enables alternate stylesheets. Multiple stylesheets can
* be used in a style, but all sheets with the same title should be
* grouped.
*
* Place this script in the body where you want the selector to appear.
* There are no HTML tags other than <_select_> and <_option_> for the style
* picker.
*
*/
if (document.styleSheets) {
function setStyle(select) {
var style=select.options[select.selectedIndex].value;
for (var i=0; i<document.styleSheets.length; i++) {
with(document.styleSheets[i]) disabled=(title!="" && title!=style);
}
select.selectedIndex=0;
}
document.writeln('<SELECT onchange="setStyle(this);">');
document.writeln('<OPTION>Select Style');
var otitle="";
for (var i=0; i<document.styleSheets.length; i++) {
var title=document.styleSheets[i].title;
if (title!="" && title!=otitle) {
document.writeln('<OPTION value="'+title+'">'+title+'</OPTION>');
otitle=title;
}
}
document.writeln("</SELECT>")
}
</SCRIPT>