/    Sign up×
Community /Pin to ProfileBookmark

acces to document object of container

I have a menu page that loads into the iframe of my content pages.
Some content pages use different stylesheets and i want the menu to load the same stylesheet.

I know i can do it by writing the menu in with javascript, but that makes the code badly readable.

I’d like to know how to tell the framed menu to read from the main documents document-object, where the styleSheet.href property resides?

something like
document.styleSheets[0].href = top.document.styleSheets[0].href
does not work

any help would be appriciated

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangOct 07.2004 — Why and in the are you not loading the menu styles with the menu page?
Copy linkTweet thisAlerts:
@hastalavistaauthorOct 07.2004 — because i want it to look different, depending on the contentpage

take a look at

www.hastalavista.dds.nl/ozu/repertoire/follies/index.html

scroll to the bottom and click personnel

then scroll to the bottom again and notice same menu, different background, but done by loading a js file for each content page

and a variable to accessed with window-object bla bla bla, i want

it to be done by the menu page alone. I'd consider that neat

programming.

ok, throw me names....
Copy linkTweet thisAlerts:
@FangOct 07.2004 — If you have the extra, PHP, with dds hosting, then consider using a template and dump the iframe. Do it all server side.

A [URL=http://www.alistapart.com/articles/n4switch/]style switcher[/URL] is also an option.
Copy linkTweet thisAlerts:
@hastalavistaauthorOct 07.2004 — style switcher, interesting... thanks.
×

Success!

Help @hastalavista spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...