$(sel).offset().top // jQuery
el.getBoundingClientRect().top + pageYOffset - document.documentElement.clientTop // pure JS
- fixed-point 固定小数点
- Floating Point 浮動小数点
- exponential notation 指数表記
method | return |
---|---|
toFixed | f |
toPrecision | f, e |
toExponential | e |
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
/*----------------- | |
* 色に関しては2つだけ | |
* - color | |
* - clip | |
* 残りは画像に適用 | |
-----------------*/ | |
.bg { | |
width: 200px; | |
height: 200px; |
to insert/change a textNode value, there are 3 ways.
text.data = null
text.nodeValue = undefined
text.textContent = undefined
Whichever method you use, be sure to take a fallback for undefined/null
.
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
var delayResize = { | |
delays: [300, 600, 900], | |
timers: [], | |
clearAlltimers: function() { | |
var l = this.timers.length | |
for(var i=0; i<l; i++){ | |
clearTimeout(this.timers[i]) | |
} | |
}, | |
dispachEv: function(e){ |
add tags/attributes.
[snippet],[css],[dropdown]
- category
- snippet
- demo
- memo
- doc
- main-lang
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
http://readingmonkey.blog45.fc2.com/blog-entry-674.html |
OlderNewer