James Robson

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJames Robson
ToMe
SubjectHelp needed on changeStyle script
Date12 November 2005 16:55
Hi there,

Thanks in advance for any help you can provide me.  I'm in the process of
building a site and thought your changeStyle script would be great for
improving accessibility.  The problem seems to be that I'm using frames and
I'm not sure how to change the style in another frame.  The script works
perfectly in the parent frame (banner.htm).

The live URL I'm working on is [URL]

I searched your site for any similar question and found some advice you
provided on working with iframes.  With this in mind I added the following
to the onclick event, to try and push the style to the frame called "main".
 
;<input type="button" value="Use Default"
onclick="changeStyle('Default');window.frames['main'].window.changeStyle('Default')"><br>
;<input type="button" value="Use Pretty"
onclick="changeStyle('Pretty');window.frames['main'].window.changeStyle('Pretty')"><br>
;<input type="button" value="Use High Contrast"
onclick="changeStyle('High Contrast');window.frames['main'].window.changeStyle('High Contrast')"></p>

...which just results in the attached error.  I've added the script call and
the onload/onunload line to the target page (main.htm)

Assuming this is possible, how would I also change the style in the third
frame (sidebar.htm)?
Also, you define how to store the cookie until the browser is closed, and
for 10 days - how would I store it indefinately?

Sorry, I'm perhaps a bit of a dunce when it comes to script (you may have
noticed...). 

Hoping you can help.  Many thanks,


James
FromMe
ToJames Robson
SubjectRe: Browser stats
Date12 November 2005 18:27
James,

> I searched your site for any similar question and found some advice
> you provided on working with iframes.

Close, only a couple of little changes you need to make. iframes are
different to normal framesets.

1. with a frameset, the frames are held by the parent page, not the current
page.

2. iframes need the extra .window - real frames do not need that.

onclick="changeStyle('Default');parent.frames['main'].changeStyle('Default');"


Other than that, you need to add all the extra style tags to the main frame as well.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromJames Robson
ToMe
SubjectRe: Browser stats
Date20 November 2005 10:59
Hi Tarquin,

I just realised I never thanked you for responding to my plea for help. 
Thank you so much - that's working fine now.

I may have one other query, but I'll try and work it out before pestering 
you again.

thanks again,


James
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.