View Full Version : Resolved Style Sheet Switcher (v1.1)

09-25-2011, 02:43 AM
Style Sheet Switcher (v1.1)
2) Script URL (on DD): (http://www.dynamicdrive.com/dynamicindex9/stylesheetswitcher.htm)


Not really a problem, actually. I'm pretty iffy with JavaScript and other client side languages but I'd like to have this script set the style to both frames in a frameset. Is that possible without putting the script in each window and asking the user to set it manually for both?

Yes I know frames are so vulgar and icky, but I have an oldschool legacy chat site that still uses them so they aren't going to change anytime soon.

09-25-2011, 03:53 AM
All the pages, including the frameset page have to be on the same domain. And there has to be just one frameset page at a time, you can't have a frameset page as a page in one of the frames. Well you could, but it would get more complicated, perhaps much more complicated.

So if that's the story, here's what I'd do. First use this version of the script:


Put the script and the stylesheets on all of the pages except the frameset and any pages you don't want to change styles. Use the same script and stylesheets for all**. Make sure the style sheet switcher script on each of the individual pages is working. That will test to see that the paths to stylesheets and the script file are correct. Next, on your pages replace stuff like:

<input type="radio" name="choice" value="none" onClick="chooseStyle(this.value, 60)">Default style<br />


<input type="radio" name="choice" value="none" onClick="styleframes(this.value, 60)">Default style<br />

The browser cache may need to be cleared and/or the page refreshed to see changes.

Tested and works. If there are problems, let me know and give me a link to the page.

**You could have different stylesheets on the pages, but they would have to have the same titles. You could have different scripts, but it would be a waste of space and bandwidth, they have to all be the same code anyway.

09-26-2011, 01:22 AM
Wow, thanks a ton! I didn't expect a reply that fast (or I would have checked again last night) nor did I expect to have someone actually work it out for me.

Again - many, many thanks!!!