Closed Thread Icon

Topic awaiting preservation: stylesheets and frames (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=7891" title="Pages that link to Topic awaiting preservation: stylesheets and frames (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: stylesheets and frames <span class="small">(Page 1 of 1)</span>\

 
bunchapixels
Neurotic (0) Inmate
Newly admitted
posted posted 10-18-2001 09:17

hi peoples,
just drowning in uni work at the moment, and i was wondering if anyone can lend a quick hand:
can you specify the stylesheet used in a child frame by the parent frame? ie can the page that outlines the framesets outline the common stylesheet for all child frames?
if anyone can provide help here that would be great thanks!
cheers.

___________________
b u n c h a p i x e l s

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 10-18-2001 21:52

You can use JS to dynamically add appropriate <LINK> tag to all frames... The following code (I've tested it only in IE) will add LINK tag to the first frame that's in the frameset:

<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!-- ;
function initStyleSheets() {
&nbsp;&nbsp;&nbsp;&nbsp;maxStyle = top.frames[0].document.createElement("<LINK REL=\"StyleSheet\" HREF=\"style1.css\" TYPE=\"text/css\">");
&nbsp;&nbsp;&nbsp;&nbsp;top.frames[0].document.appendChild(maxStyle);
}
window.onload = initStyleSheets;
// -->
</SCRIPT>


bunchapixels
Neurotic (0) Inmate
Newly admitted
posted posted 10-30-2001 07:54

hey max,
can you tell me what is wrong with this?

code:
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!-- ;

var root_url = "http://charlie.it.uts.edu.au/~dchong/intranet/Documents/Code";

function initStyleSheets() {
alert(top.frames[1].name);
help_style = top.frames[1].document.createElement("<LINK REL=\"StyleSheet\" HREF=\""+ root_url + "/style/help.css\" TYPE=\"text/css\">");
top.frames[1].document.appendChild(help_style);
}

window.onload = initStyleSheets;

// -->
</SCRIPT>



it kinda dies at the appendChild line, as the "object or property does not support this property or method".
i have IE 5.5 here...
oh yeah, the alert is there just to make sure i'm referring to the right one...
cheers for your help,


___________________
b u n c h a p i x e l s

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 10-30-2001 18:01

Can you show me the complete frameset?


« BackwardsOnwards »

Show Forum Drop Down Menu