Ai
1 Star 0 Fork 0

ubuntuvim/programmer_daily

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
core.js 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
ubuntuvim 提交于 2015-07-22 02:06 +08:00 . complete index...
;(function(window){
var
// Is Modernizr defined on the global scope
Modernizr = typeof Modernizr !== "undefined" ? Modernizr : false,
// Always expect both kinds of event
buttonPressedEvent = 'touchstart click',
// List of all animation/transition properties
// with its animationEnd/transitionEnd event
animationEndEventNames = {
'WebkitAnimation' : 'webkitAnimationEnd',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
'animation' : 'animationend'
},
transitionEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd',
'OTransition' : 'oTransitionEnd',
'msTransition' : 'MSTransitionEnd',
'transition' : 'transitionend'
},
Effeckt = function() {
this.init();
};
// Current version.
Effeckt.version = '0.0.1';
// Initialization method
Effeckt.prototype.init = function() {
this.buttonPressedEvent = buttonPressedEvent;
//event trigger after animation/transition end.
this.transitionEndEventName = Modernizr ? transitionEndEventNames[Modernizr.prefixed('transition')] : getTransitionEndEventNames();
this.animationEndEventName = Modernizr ? animationEndEventNames[Modernizr.prefixed('animation')] : getAnimationEndEventNames();
this.transitionAnimationEndEvent = this.animationEndEventName + ' ' + this.transitionEndEventName;
};
Effeckt.prototype.getViewportHeight = function() {
var docElement = document.documentElement,
client = docElement['clientHeight'],
inner = window['innerHeight'];
if( client < inner )
return inner;
else
return client;
};
// Get all the properties for transition/animation end
function getTransitionEndEventNames() {
return _getEndEventNames( transitionEndEventNames );
}
function getAnimationEndEventNames() {
return _getEndEventNames( animationEndEventNames );
}
function _getEndEventNames(obj) {
var events = [];
for ( var eventName in obj ) {
events.push( obj[ eventName ] );
}
return events.join(' ');
}
// Creates a Effeckt object.
window.Effeckt = new Effeckt();
})(this);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ubuntuvim/programmer_daily.git
git@gitee.com:ubuntuvim/programmer_daily.git
ubuntuvim
programmer_daily
programmer_daily
master

搜索帮助