Skip to content

Instantly share code, notes, and snippets.

@d-adamkiewicz
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d-adamkiewicz/9d9d149b959b5d5f2820 to your computer and use it in GitHub Desktop.
Save d-adamkiewicz/9d9d149b959b5d5f2820 to your computer and use it in GitHub Desktop.
YUI3.16.0/getStyle('background-image') bug - IE8/Firefox 29.0.1
<!DOCTYPE html>
<html>
<head>
<title>YUI3.16.0/getStyle('background-image') bug - IE8/Firefox 29.0.1</title>
<meta charset="utf-8" />
<style type="text/css">
.pick div {
background-image: url(rect.png);
width: 41px;
height: 41px;
}
</style>
<script src="http://yui.yahooapis.com/3.16.0/build/yui/yui-min.js"></script>
</head>
<body>
<span class="pick"><div id="some">&nbsp;</div></span>
<script>
YUI().use('node', function(Y) {
// works in Chrome, doesn't in IE8/FF29
console.log(Y.one('#some').getStyle('background-image'));
// works in Chrome/IE8/FF29
console.log(Y.one('#some').getStyle('backgroundImage'));
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment