I have a website that uses jQuery UI themes. On this site, there is an iFrame containing another HTML document also utilizing jQuery UI themes. I have created my own theme selector and now want to know the simplest way to apply this selection to the content within the iFrame. For instance, when a user chooses a new theme, I can simply do this:
<link id="uiTheme" rel="stylesheet" type="text/css" href="ui/smoothness.css" />
$("#uiTheme").attr("href", "ui/" + newTheme + ".css");
Here, newTheme
represents the name of a different theme provided through a select box. My question is: How can I use a jQuery selector to target the link with the id innerTheme
in order to change its href attribute to match the stylesheet used on the main page? Do I need to specifically address this, or will the outer page's theme automatically be applied to the iFrame content without the iframe itself linking to a stylesheet?
If my explanation is unclear, I apologize. I am happy to clarify any points if necessary.