|
| |
|
|
leanneB14
Posts: 36 Joined: 2/19/2004 Status: offline
|
Using CSS and Javascript together - 2/19/2004 22:39:17
Hi I have a slight problem, My site uses a javascript drop down menu. I have recently changed to using frames and now this drop down menu has its top level in one frame and then the drop downs appear in the frame below. The problem is, i need to put some javascript in the body tag of every page going to be in the frame that has the drop downs on it. I have many pages and don't want to have to manually go through and implement this. Another reason is that other people at work will be creating their own subwebs but usign my global navigation, so i don't want to rely on them to add the code. Is the any way i can put this in the stylesheet. Currently this is what i have but it doesn't work body {onload: javascript:{if(parent.frames[0]&&parent.frames['contents'].Go)parent.frames['contents'].Go()}; margin: 0px; padding: 0px;} this is what i'd put in the html file <body onload="javascript:{if(parent.frames[0]&&parent.frames['contents'].Go)parent.frames['contents'].Go()}"> Can anyone help?
|
|
|
|
Giomanach
Posts: 6115 Joined: 11/19/2003 From: England Status: offline
|
RE: Using CSS and Javascript together - 2/20/2004 3:39:34
quote:
body {onload: javascript:{if(parent.frames[0]&&parent.frames['contents'].Go)parent.frames['contents'].Go()}; margin: 0px; padding: 0px;} As far as I know, that is far from valid CSS. I'm not even sure onload is a CSS command. Unless I'm wrong, of which I seem to be good at recently, JavaScript can't be implemented into a CSS style sheet. Unfortunatley, I believe that JavaScript is all done through the HTML document, rather than trying to be clever and putting it into the CSS style sheet. HTH Dan
_____________________________
|
|
|
|
leanneB14
Posts: 36 Joined: 2/19/2004 Status: offline
|
RE: Using CSS and Javascript together - 2/22/2004 17:21:29
Thanks anyway. It looks like i'm going to have to either implement the onload in every page, or just forget about the frames version of my intranet. Or maybe use a CSS drop down menu.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|