<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Dynamically Load Stylesheets Using MooTools&#160;1.2</title> <atom:link href="http://davidwalsh.name/dynamically-load-stylesheets-mootools/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Tue, 22 May 2012 16:21:46 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Chris G</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-18980</link> <dc:creator>Chris G</dc:creator> <pubDate>Fri, 23 Jul 2010 06:32:36 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-18980</guid> <description>I&#039;d use $(body).toggleClass(&#039;enlarge&#039;); and then write css rules asbody p{
font-size:12px;
}body,enlarge p{
font-size:16px;
}Now you dont have to reload css files and have all the css in one file too.</description> <content:encoded><![CDATA[<p>I&#8217;d use $(body).toggleClass(&#8216;enlarge&#8217;); and then write css rules as</p><p>body p{<br
/> font-size:12px;<br
/> }</p><p>body,enlarge p{<br
/> font-size:16px;<br
/> }</p><p>Now you dont have to reload css files and have all the css in one file too.</p> ]]></content:encoded> </item> <item><title>By: J.v.C</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-17273</link> <dc:creator>J.v.C</dc:creator> <pubDate>Mon, 26 Apr 2010 01:52:03 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-17273</guid> <description>Thanks for information! =)</description> <content:encoded><![CDATA[<p>Thanks for information! =)</p> ]]></content:encoded> </item> <item><title>By: Larry</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15668</link> <dc:creator>Larry</dc:creator> <pubDate>Wed, 27 Jan 2010 23:39:35 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15668</guid> <description>Great stylesheet switcher. I use it for my print and large text versions of pages and it works great.But...I&#039;m switching my CSS scheme to have a core stylesheet and then supplemental stylesheets for different sections of the site. Is there a way to have the &quot;rel&quot; attribute on &lt;a&gt; tags define 2 stylesheets?I need another stylesheet when loading from this link (wsm_feature.css) following the wsm_core.css:&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Return to web page&lt;/a&gt;</description> <content:encoded><![CDATA[<p>Great stylesheet switcher. I use it for my print and large text versions of pages and it works great.</p><p>But&#8230;I&#8217;m switching my CSS scheme to have a core stylesheet and then supplemental stylesheets for different sections of the site. Is there a way to have the &#8220;rel&#8221; attribute on <a> tags define 2 stylesheets?</p><p>I need another stylesheet when loading from this link (wsm_feature.css) following the wsm_core.css:</p><p></a><a
href="#" rel="nofollow">Return to web page</a></p> ]]></content:encoded> </item> <item><title>By: Mike from MightyProds</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15566</link> <dc:creator>Mike from MightyProds</dc:creator> <pubDate>Mon, 25 Jan 2010 14:16:41 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15566</guid> <description>var css = new Element(&#039;link&#039;, { type: &#039;text/css&#039;, rel: &#039;stylesheet&#039;, href: &#039;editeur.css&#039; });
css.inject(myFrame.contentWindow.document.getElementsByTagName(&quot;head&quot;)[0]);It&#039;s ok on FireFox but I eared it doesnt work on IE (but not tested)... I&#039;ve search for a long time how to access head tag with mootools (wich is better cross browser than my previous uggly code !) but I&#039;ve failed... Perhaps it doesnt exist ? Anyway, that work for me with FF, that was my mainly goal !</description> <content:encoded><![CDATA[<p>var css = new Element(&#8216;link&#8217;, { type: &#8216;text/css&#8217;, rel: &#8216;stylesheet&#8217;, href: &#8216;editeur.css&#8217; });<br
/> css.inject(myFrame.contentWindow.document.getElementsByTagName(&#8220;head&#8221;)[0]);</p><p>It&#8217;s ok on FireFox but I eared it doesnt work on IE (but not tested)&#8230; I&#8217;ve search for a long time how to access head tag with mootools (wich is better cross browser than my previous uggly code !) but I&#8217;ve failed&#8230; Perhaps it doesnt exist ? Anyway, that work for me with FF, that was my mainly goal !</p> ]]></content:encoded> </item> <item><title>By: Mike from MightyProds</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15560</link> <dc:creator>Mike from MightyProds</dc:creator> <pubDate>Mon, 25 Jan 2010 09:57:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15560</guid> <description>Found a solution :var css = new Element(&#039;link&#039;, { type: &#039;text/css&#039;, rel: &#039;stylesheet&#039;, href: &#039;styles.css&#039; });
css.inject(myFrame.contentWindow.document.body, &#039;top&#039;);but even cant find a solution to work with asset... And it makes me a problem : the css link is in the body tag, not in head... But I dont know how to access head of my IFrame to inject my css link... If anyone have an idea...</description> <content:encoded><![CDATA[<p>Found a solution :</p><p>var css = new Element(&#8216;link&#8217;, { type: &#8216;text/css&#8217;, rel: &#8216;stylesheet&#8217;, href: &#8216;styles.css&#8217; });<br
/> css.inject(myFrame.contentWindow.document.body, &#8216;top&#8217;);</p><p>but even cant find a solution to work with asset&#8230; And it makes me a problem : the css link is in the body tag, not in head&#8230; But I dont know how to access head of my IFrame to inject my css link&#8230; If anyone have an idea&#8230;</p> ]]></content:encoded> </item> <item><title>By: Mike from MightyProds</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15556</link> <dc:creator>Mike from MightyProds</dc:creator> <pubDate>Mon, 25 Jan 2010 08:44:08 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15556</guid> <description>Hi,Thx for your great blog, mooTools rocks and you rocks too :)For now, I try to implement the same thing but for an Iframe that is created from mooTools... I dont know how to assign the stylesheet to my IFrame (which source is about:blank) from the script that create this IFrame...If you have an idea, that would greatly help me, cause I really dont know by where I must start, I found no parameter for designate the document that receive the stylesheet...And sorry for my bad english...And again, big up for your blog, you rocks !</description> <content:encoded><![CDATA[<p>Hi,</p><p>Thx for your great blog, mooTools rocks and you rocks too :)</p><p>For now, I try to implement the same thing but for an Iframe that is created from mooTools&#8230; I dont know how to assign the stylesheet to my IFrame (which source is about:blank) from the script that create this IFrame&#8230;</p><p>If you have an idea, that would greatly help me, cause I really dont know by where I must start, I found no parameter for designate the document that receive the stylesheet&#8230;</p><p>And sorry for my bad english&#8230;</p><p>And again, big up for your blog, you rocks !</p> ]]></content:encoded> </item> <item><title>By: Ken</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15287</link> <dc:creator>Ken</dc:creator> <pubDate>Fri, 15 Jan 2010 02:52:20 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15287</guid> <description>Indeed can be great to have a fading effect, with a listener for the day time you can for example use a fade transition from a day css to a night css :) i love this idea..Anyway dont really know why but this code doesnt work for me.. i use it with the last version of Mootools and change $$ by document.search() but still doesnt work.Strange thing, the click load the true link, i m pretty sure my code is good implemented..css and js folders are on the same level in my folder architecture.HTML :&lt;a href=&quot;&quot; rel=&quot;nofollow&quot;&gt;DAY&lt;/a&gt;JS in the header just to be sure :window.addEvent(&#039;domready&#039;, function () {
//for every anchor with the class &quot;load-css&quot;...
document.search(&#039;.load-css&#039;).each(function(el) {
//add a click  event to add the stylesheet
el.addEvent(&#039;click&#039;, function() {
//get the file. file is based on the anchor&#039;s rel attribute
var css = new Asset.css(el.get(&#039;rel&#039;), { });
});
});
});If you have any idea.. Thank you for this blog it rocks :)</description> <content:encoded><![CDATA[<p>Indeed can be great to have a fading effect, with a listener for the day time you can for example use a fade transition from a day css to a night css :) i love this idea..</p><p>Anyway dont really know why but this code doesnt work for me.. i use it with the last version of Mootools and change $$ by document.search() but still doesnt work.</p><p>Strange thing, the click load the true link, i m pretty sure my code is good implemented..</p><p>css and js folders are on the same level in my folder architecture.</p><p>HTML :</p><p><a
href="" rel="nofollow">DAY</a></p><p>JS in the header just to be sure :</p><p>window.addEvent(&#8216;domready&#8217;, function () {<br
/> //for every anchor with the class &#8220;load-css&#8221;&#8230;<br
/> document.search(&#8216;.load-css&#8217;).each(function(el) {<br
/> //add a click  event to add the stylesheet<br
/> el.addEvent(&#8216;click&#8217;, function() {<br
/> //get the file. file is based on the anchor&#8217;s rel attribute<br
/> var css = new Asset.css(el.get(&#8216;rel&#8217;), { });<br
/> });<br
/> });<br
/> });</p><p>If you have any idea.. Thank you for this blog it rocks :)</p> ]]></content:encoded> </item> <item><title>By: Doney</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-15244</link> <dc:creator>Doney</dc:creator> <pubDate>Wed, 13 Jan 2010 17:34:59 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-15244</guid> <description>Is there a way to make a fading transition to another stylesheet? :)</description> <content:encoded><![CDATA[<p>Is there a way to make a fading transition to another stylesheet? :)</p> ]]></content:encoded> </item> <item><title>By: TimP</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-8008</link> <dc:creator>TimP</dc:creator> <pubDate>Tue, 03 Mar 2009 12:01:29 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-8008</guid> <description>This, like so much in MooTools is very nice, however I have a problem with the use of class and rel attributes.For me this would work without mis-use of attributes if each stylesheet theme link had a different id attribute
and the rel attribute was not specified.ievar css = new Asset.css(el.get(&#039;id&#039;), { }); </description> <content:encoded><![CDATA[<p>This, like so much in MooTools is very nice, however I have a problem with the use of class and rel attributes.</p><p>For me this would work without mis-use of attributes if each stylesheet theme link had a different id attribute<br
/> and the rel attribute was not specified.</p><p>ie</p><p>var css = new Asset.css(el.get(&#8216;id&#8217;), { });</p> ]]></content:encoded> </item> <item><title>By: david</title><link>http://davidwalsh.name/dynamically-load-stylesheets-mootools#comment-2865</link> <dc:creator>david</dc:creator> <pubDate>Thu, 28 Aug 2008 18:47:52 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=273#comment-2865</guid> <description>&lt;p&gt;@Matthew:  Yes, but if you planned to use a system like this, you&#039;d keep that in mind.  I&#039;d recommend one &quot;structure&quot; CSS file and many &quot;theme&quot; CSS files.&lt;/p&gt;</description> <content:encoded><![CDATA[<p>@Matthew:  Yes, but if you planned to use a system like this, you&#8217;d keep that in mind.  I&#8217;d recommend one &#8220;structure&#8221; CSS file and many &#8220;theme&#8221; CSS files.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/7 queries in 0.007 seconds using disk: basic
Object Caching 812/813 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-22 17:16:45 -->
