jquery - How to dynamically change the stylesheet of an HTML page within an iFrame of another page? -
jquery - How to dynamically change the stylesheet of an HTML page within an iFrame of another page? -
i have web page makes utilize of jquery ui themes. within page, there's iframe holding html document makes utilize of jquery ui themes. now, have made own theme selecter, , i'd know easiest way have impact page within iframe. example, whenever user selects new theme, simple like:
<link id="uitheme" rel="stylesheet" type="text/css" href="ui/smoothness.css" /> $("#uitheme").attr("href", "ui/" + newtheme + ".css");
where newtheme
string literal of different them (all done through select box, , know works , such). now, how can alter sheet beingness used within frame match of main page? guess question how can utilize jquery selector grab link id of innertheme
alter it's href attribute same stylesheet? furthermore, need worry this, or ui-theme of outer page automatically descend frame without frame's page linking stylesheet?
if question bit confusing, apologize. can seek clear if need be.
you don't have reference link element - add together own , override.
var link = document.createelement('link'); link.href = "http://full.domain.com/ui/smoothness.css"; link.type = 'text/css'; link.rel = 'stylesheet'; $('head', framename )[0].appendchild(link);
however, won't able modify in other frame if it's coming domain. if it's beingness served same domain - may easier create alter on original page. if it's coming site - sadly you're out of luck.
jquery css inheritance iframe stylesheet
Comments
Post a Comment