Last active
November 18, 2015 02:37
-
-
Save letiantian/803a559216f556bcaf5d to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
body { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addElement() { | |
var div = document.createElement('div'); | |
div.setAttribute('class', 'mydiv'); | |
div.setAttribute('id', 'fixed-div'); | |
div.style["background"] = "#222 none repeat scroll 0 0"; | |
div.style["bottom"] = "45px"; | |
div.style["cursor"] = "pointer"; | |
div.style["height"] = "15px"; | |
div.style["line-height"] = "0"; | |
div.style["padding"] = "5px"; | |
div.style["position"] = "fixed"; | |
div.style["right"] = "50px"; | |
div.style["width"] = "15px"; | |
div.style["z-index"] = "1050"; | |
div.onclick = function() {alert("hi");} | |
document.body.appendChild(div); | |
} | |
addElement(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split-vertical","fontsize":"90","seethrough":"","prefixfree":"1","page":"javascript"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment