This file contains hidden or 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 | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; |
This file contains hidden or 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
.example{ | |
position: relative; | |
margin: 15px 0 15px 20px; | |
padding: 39px 19px 14px; | |
background-color: white; | |
border: 1px solid #DDD; | |
-webkit-border-radius: 4px; | |
-moz-border-radius: 4px; | |
border-radius: 4px; | |
} |
This file contains hidden or 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
<div id="monalisa" /> |
This file contains hidden or 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
var Util = {}; | |
Util.supportInputFile = function() { | |
var input = document.createElement('input'), | |
support = false; | |
input.type = 'file'; | |
// ios < 6, 会设置input为disabled | |
if (input.type === 'file' && !input.disabled) { | |
support = true; | |
} | |
this.supportInputFile = function() { |
This file contains hidden or 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() { | |
var image = new Image(); | |
image.onload = function() { | |
if (image.width > 0) { | |
document.documentElement.className += (document.documentElement.className != '') ? ' images-on' : 'images-on'; | |
} | |
}; | |
image.src = 'px.png'; | |
}()); |
This file contains hidden or 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
<img style="position:absolute;left:-9999px;" src="#" onerror="(function() {var s = document.createElement('script');s.src='xxx.js';var head=document.getElementsByTagName('head')[0]; head.appendChild(s);})()" /> | |
<!-- no quote version --> | |
<img style=position:absolute;left:-9999px; src=# onerror=document.getElementsByTagName('head')[0].appendChild(document.createElement('script')).src='xxx.js' /> |
This file contains hidden or 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
/** | |
* 简易动画函数 | |
* | |
* @param {HTMLElement} dom 需要执行动画的元素 | |
* @param {Object} props 例如:{'width': 100}. | |
* @param {function(HTMLElement)=} opt_complete 「可选」动画结束后的回调函数 | |
* @param {Object=} opt_options 配置 | |
* @config {number} interval 动画间隔时间 | |
* @config {function} easing 补间函数 | |
* @config {number} duration 动画耗时 |
This file contains hidden or 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
/* Firefox 2 */ | |
html>/**/body .selector, x:-moz-any-link { | |
color:lime; | |
} | |
/* Firefox 3 */ | |
html>/**/body .selector, x:-moz-any-link, x:default { | |
color:lime; | |
} |
This file contains hidden or 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 randomColor(){ | |
return "rgb("+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+","+Math.floor(Math.random()*255)+")"; | |
} | |
function showBoxes(window) { | |
var rects = []; | |
function getRects(node){ | |
var range = window.document.createRange(); | |
range.setStartBefore(node); | |
range.setEndAfter(node); | |
This file contains hidden or 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
// Reliably grab my script tag | |
function getScript() { | |
var script; | |
if (!(script = document.currentScript)) { | |
script = document.getElementsByTagName("script"); | |
script = script[script.length - 1]; | |
} | |
return script; | |
} |
OlderNewer