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() { | |
if ( !Element.__defineGetter__ || Element.prototype.hasOwnProperty("classList") ) return; | |
function classList(elm) { | |
this.elm = elm; | |
} | |
classList.prototype = { | |
add: function(klass) { | |
var _elm = this.elm, |
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
/* | |
* Bind events | |
* bind(obj, listener, func) | |
* or | |
* bind(obj, { | |
* listener : func, | |
* listener2 : func2, | |
* // and more | |
* }) | |
*/ |
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
/* | |
* bind, unbind | |
* | |
* @author : nori(norimanai@gmail.com) | |
* @copyright : 5509(http://5509.me/) | |
* @license : The MIT License | |
* @modified : 2011-04-09 01:30 | |
* | |
* HOW TO USE | |
* bind event : bind(elm, type, func) or bind(elm, {}) |
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
/* | |
* CSS - set css style(s) | |
* | |
* HOW TO USE | |
* set css style : elm.css(type, val) | |
* set css styles : elm.css({type1: val1, type2: val2, ...}) | |
*/ | |
Element.prototype.css = function() { // arguments: (style, val) or {} | |
var _a = arguments, i, hash; |
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
/* | |
* Queue | |
* | |
* @author : nori(norimanai@gmail.com) | |
* @copyright : 5509(http://5509.me/) | |
* @license : The MIT License | |
* @modified : 2011-04-08 13:22 | |
*/ | |
// 汎用キューコンストラクタ | |
function Queue() { |
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 _trigger(elm, listener) { | |
var evtObj = undefined; | |
if ( 'createEvent' in document ) { | |
evtObj = document.createEvent('UIEvents'); | |
evtObj.initEvent(listener, false, true); | |
elm.dispatchEvent(evtObj); | |
} else | |
if ( 'createEventObject' in document ) { | |
evtObj = document.createEventObject(); | |
evtObj.name = listener; |
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 animate(elem, styles, duration, easing) { | |
var dfd = new Deferred(), | |
fps = undefined, | |
current_time = 0, | |
style_key = undefined, | |
start_value = undefined, | |
end_value = undefined, | |
pt = '', | |
rev = false, | |
diff_start = 0, |
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 each(arr, func) { | |
var i = 0, | |
l = arr.length; | |
for ( ; i < l; i = i + 1 ) { | |
func.apply( | |
arr[i], | |
([i]).concat(arguments) | |
); | |
} |
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
# Repeat func | |
# | |
# @param {} | |
# { | |
# interval: 50, | |
# func: -> | |
# console.log 'func' | |
# } | |
# | |
# or |
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
$use: | |
-webkit-, true, | |
-moz-, true, | |
-o-, true, | |
-ms-, false; | |
@mixin addPrefix($property, $value, $def: false) { | |
$property: unquote($property); | |
$value: unquote($value); | |
@for $i from 1 through length($use)/2 { |
OlderNewer