Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AndreMikulec/337251 to your computer and use it in GitHub Desktop.
Save AndreMikulec/337251 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Simple IE style overrides problem</title>
<script type="text/javascript" src="http://yui.yahooapis.com/3.1.0pr2/build/yui/yui-debug.js"></script>
<style id="styleoverrides" type="text/css">
html {
background-color: #dfb8df; /* purple */
}
</style>
<script type="text/javascript">
YUI({
base: 'http://yui.yahooapis.com/3.1.0pr2/build/', // the base path to the YUI install
charset: 'utf-8', // specify a charset for inserted nodes, default is utf-8
loadOptional: true, // automatically load optional dependencies, default false
combine: true, // use the Yahoo! CDN combo service for YUI resources, default is true unless 'base' has been changed
filter: 'debug', // apply a filter to load the raw or debug version of YUI files
timeout: 10000, // specify the amount of time to wait for a node to finish loading before aborting
// 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.
insertBefore: 'styleoverrides', // The insertion point for new nodes
modules: { // one or more external modules that can be loaded along side of YUI
'yui2-resetcss': {
fullpath: "http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css",
type: 'css'
}
}
}
).use('node','yui2-resetcss', function(Y) {
var node = Y.one('#demo p');
var onClick = function(e) {
var tag = e.target.get('parentNode.tagName'); // e.target === node || #demo p em
e.currentTarget.one('em').setContent('I am a child of ' + tag + '.'); // e.currentTarget === node
};
node.on('click', onClick);
});
</script>
</head>
<body >
<div id="demo">
<p><em>Click me.</em></p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment