I want to be able to toggle a pages view from normal to print. I have set up a css for the print version and I have my normal css. I have a function that calls up the appropriate css depending on print or normal selection.
Unfortuantely, each browser requires different function to work. How do I do an onClick which pulls up the required function depending on the browser in use.
Help appreciated.
The function for ie is:
function printer_friendly()
{
document.styleSheets[0].href = "rules_files/guides_print2.css";
}
function normal_view()
{
document.styleSheets[0].href = "rules_files/global.css";
}
The function for netscape is:
function printer_friendly()
{
document.styleSheets[0].disabled = true;
document.styleSheets[1].disabled = false;
}
function normal_view()
{
document.styleSheets[0].disabled = false;
document.styleSheets[1].disabled = true;
}
Thanks,
Bob
Unfortuantely, each browser requires different function to work. How do I do an onClick which pulls up the required function depending on the browser in use.
Help appreciated.
The function for ie is:
function printer_friendly()
{
document.styleSheets[0].href = "rules_files/guides_print2.css";
}
function normal_view()
{
document.styleSheets[0].href = "rules_files/global.css";
}
The function for netscape is:
function printer_friendly()
{
document.styleSheets[0].disabled = true;
document.styleSheets[1].disabled = false;
}
function normal_view()
{
document.styleSheets[0].disabled = false;
document.styleSheets[1].disabled = true;
}
Thanks,
Bob