0

I'm trying to make the code from this link work in a layout where the buttons are within an iframe element, but so that it also affects the parent window:

http://www.thesitewizard.com/javascripts/change-style-sheets.shtml

Right now when I insert the buttons into an iframe and click it, it only changes the css for the iframe. Similarly, when I place the button in the main window, it has no effect over the iframe. How can I change it to affect both at the same time, preferably with the buttons in the iframe?

Vaguely related to that, is the code for the cookie in that example outdated or something? It seems to work only very inconsistently between different browsers.

derboo
  • 1
  • 1
    Possible duplicate of http://stackoverflow.com/questions/217776/how-to-apply-css-to-iframe – Blazemonger Aug 13 '14 at 18:53
  • change " switch_style( css_title );" to " switch_style( css_title ); top.switch_style( css_title );" and make sure it's installed on both, and that the pages are on the same domain. – dandavis Aug 13 '14 at 19:59
  • Thanks, dandavis, that code was simpler that I thought. :) There remains one issue, though - when I load the page, only the embedded frame "remembers" the style setting from the cookie, even though I included in both files. What could be the reason for that? – derboo Aug 14 '14 at 03:18

0 Answers0