| Page 1 of 1 | [ 3 posts ] |
Andre Mikulec
|
Hi,
Could someone explain to me the logic behind how "insertBefore" should work? How does this affect styles? Out there, does anyone have any (simple or complicated) working examples? This is what I have so far. I my have some YUI 3 javascript code like this. Code: YUI({ base: '../yui3/build/', // the base path to the YUI install // We can specify a node that is the insertion point for // all new nodes. This // is useful for making sure css rules are applied // in the correct order. // The insertion point for new nodes insertBefore: 'sytleoverrides', Then, I may have some HTML markup like this. Code: <head> <style id="styleoverrides"></style> </head> Or Perhaps this. Code: <body> <style id="styleoverrides"></style> </body> Thank you. |
|
What that means is that when the YUILoader inserts script and link tags for the library, they will be inserted before that node.
Usually, they are appended to the head. Which means that if you are loading a stylesheet with your own CSS overrides in it. When we load our css it will load before yours so that your overrides will still work. Make sense? |
Andre Mikulec
|
I think so.
Regular behavior (without insertBefore) ----------------------------------------- YUILoader appends script and link tags at the end of the head. insertBefore behavior (insertBefore: 'styleoverrides') --------------------------------------------- YUILoader inserts script and link tags before the HTML tag <style id="styleoverrides" type="text/css"></style>. Thanks. |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group