|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Reading Stylesheet from other frames
Is it possible for a document in one frame to read and apply a stylesheet in a different frame
|
|
#2
|
|||
|
|||
|
Yes, using javascript.
Why do you want to? Hadley |
|
#3
|
|||
|
|||
|
I want to load a stylesheet once, into the parent frameset, and let all the pages within the frames apply the rules of the top.stylesheet to their own body. Can it be done?
|
|
#4
|
|||
|
|||
|
Why don't you just use the same stylesheet in all the pages?
Or do you mean you are using a stylesheet switcher to change the stylesheet for the main page? If you are, it'd probably be easiest to modify your style switcher code to change all the pages in the frameset. Hadley |
|
#5
|
|||
|
|||
|
I am trying to work around a bug that occurs in Stylesheets that are in frames that, at random moments, don't apply to the document.
|
|
#6
|
|||
|
|||
|
What is the bug? In what browser? Have you found anyone else who has had the same problem?
Hadley |
|
#7
|
|||
|
|||
|
How can I do this?
Quote:
I'm trying to do exactly what you described but I can't figure it out. I have this styleswitcher in use on my website, and it works fine except I need to apply the style switch to the a frame on my main page, too. Currently, the only way to switch the style in the frame is to navigate to a sub-page on my site and then back to my main page (which is the page with the frame). Here's the javascript function I use to switch the stylesheet. What can I add to make it apply to all pages in the frameset? function setActiveStyleSheet(title) { var i, a, main; for(i=0; (a = document.getElementsByTagName("link")[i]); i++) { if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) { a.disabled = true; if(a.getAttribute("title") == title) a.disabled = false; } } } thanks. |
|
#8
|
|||
|
|||
|
Well, instead of just operating on
Code:
a = document.getElementsByTagName("link")[i]
Hadley |
|
#9
|
|||
|
|||
|
thanks, I got it.
awesome.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Reading Stylesheet from other frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|