Skip to content

Instantly share code, notes, and snippets.

@kimwooglae
Last active December 7, 2016 00:28
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 kimwooglae/8610734 to your computer and use it in GitHub Desktop.
Save kimwooglae/8610734 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script>
function test1 () {
var obj = document.getElementById("test");
obj.style.background="yellow";
alert("obj.style.background='yellow'")
}
function test2 () {
var obj = document.getElementById("test");
obj.style.background="blue";
var b = obj.offsetHeight;
obj.style.transform = "translateZ(0)";
obj.style.zIndex="10000";
alert("obj.style.background='blue'")
}
</script>
</head>
<body>
<div id="test" style="width: 200px; height: 200px; background: #CCC;"></div>
<a href="javascript:test1()">test1</a>
<a href="javascript:test2()">test2</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment