Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 9th, 2003, 01:29 PM
Vic D Vic D is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 6 Vic D User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Reading Stylesheet from other frames

Is it possible for a document in one frame to read and apply a stylesheet in a different frame

Reply With Quote
  #2  
Old January 12th, 2003, 06:18 PM
hadley hadley is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 63 hadley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Yes, using javascript.

Why do you want to?

Hadley

Reply With Quote
  #3  
Old January 13th, 2003, 12:27 PM
Vic D Vic D is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 6 Vic D User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old January 13th, 2003, 03:01 PM
hadley hadley is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 63 hadley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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

Reply With Quote
  #5  
Old January 13th, 2003, 05:00 PM
Vic D Vic D is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 6 Vic D User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #6  
Old January 14th, 2003, 04:11 PM
hadley hadley is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 63 hadley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
What is the bug? In what browser? Have you found anyone else who has had the same problem?

Hadley

Reply With Quote
  #7  
Old May 11th, 2004, 11:25 PM
rsobers rsobers is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 rsobers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How can I do this?

Quote:
Originally Posted by hadley
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

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.

Reply With Quote
  #8  
Old May 11th, 2004, 11:40 PM
hadley hadley is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 63 hadley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Well, instead of just operating on
Code:
a = document.getElementsByTagName("link")[i]
you'll need to loop through each document in the frameset doing the same thing.

Hadley

Reply With Quote
  #9  
Old May 12th, 2004, 01:08 AM
rsobers rsobers is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 2 rsobers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks, I got it.

awesome.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Reading Stylesheet from other frames


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT