georgeocrawford
Technical User
Hi there - wonder if anyone can help...
I have a page with a simple flash animation at the top. When the animation reaches the last frame, I want to change the style sheet for the whole page to a different one. (purpose: to make some previously invisible elements suddenly appear, without a page refresh being necessary).
I have got this far:
The final frame of the animation has this actionscript:
...which was the recommended way of addressing the browser's JavaScript. (I also tried FS_command, which seemed to be less successful)
Then in my HTML header:
This works perfectly on my Mac with Safari and Netscape, but not Internet Explorer. Also seems to work on Windoze XP.
I would like to know if this is the best approach? Which platforms/browsers should this work on? How can I hard-wire the second style sheet to the page for any browsers which won't do my function properly?
I am a JavaScript novice I'm afraid. Could I first test if the change_style function will work, and if not, do a document.write to hard-wire the second style sheet to the page?
Thanks for any help!
______________________
George
I have a page with a simple flash animation at the top. When the animation reaches the last frame, I want to change the style sheet for the whole page to a different one. (purpose: to make some previously invisible elements suddenly appear, without a page refresh being necessary).
I have got this far:
The final frame of the animation has this actionscript:
Code:
getURL("javascript:change_style('style2')");
...which was the recommended way of addressing the browser's JavaScript. (I also tried FS_command, which seemed to be less successful)
Then in my HTML header:
Code:
<link id="style" rel="stylesheet" href="style.css" type="text/css">
<script language="JavaScript" type=" text/javascript">
function change_style(style_sheet) {
document.getElementById('style').href = style_sheet + '.css';
}
</script>
This works perfectly on my Mac with Safari and Netscape, but not Internet Explorer. Also seems to work on Windoze XP.
I would like to know if this is the best approach? Which platforms/browsers should this work on? How can I hard-wire the second style sheet to the page for any browsers which won't do my function properly?
I am a JavaScript novice I'm afraid. Could I first test if the change_style function will work, and if not, do a document.write to hard-wire the second style sheet to the page?
Thanks for any help!
______________________
George