js/jquery.stellar.min.js
(开头部分) 16KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*! Stellar.js v0.6.1 | Copyright 2013, Mark Dalgleish | http://markdalgleish.com/projects/stellar.js | http://markdalgleish.mit-license.org */
(function(e, t, n, r) {
function d(t, n) {
this.element = t, this.options = e.extend({}, s, n), this._defaults = s, this._name = i, this.init()
}
var i = "stellar", s = {scrollProperty: "scroll",positionProperty: "position",horizontalScrolling: !0,verticalScrolling: !0,horizontalOffset: 0,verticalOffset: 0,responsive: !1,parallaxBackgrounds: !0,parallaxElements: !0,hideDistantElements: !0,hideElement: function(e) {
e.hide()
},showElement: function(e) {
e.show()
}}, o = {scroll: {getLeft: function(e) {
return e.scrollLeft()
},setLeft: function(e, t) {
e.scrollLeft(t)
},getTop: function(e) {
return e.scrollTop()
},setTop: function(e, t) {
e.scrollTop(t)
}},position: {getLeft: function(e) {
return parseInt(e.css("left"), 10) * -1
},getTop: function(e) {
return parseInt(e.css("top"), 10) * -1
}},margin: {getLeft: function(e) {
return parseInt(e.css("margin-left"), 10) * -1
},getTop: function(e) {
return parseInt(e.css("margin-top"), 10) * -1
}},transform: {getLeft: function(e) {
var t = getComputedStyle(e[0])[f];
return t !== "none" ? parseInt(t.match(/(-?[0-9]+)/g)[4], 10) * -1 : 0
},getTop: function(e) {
var t = getComputedStyle(e[0])[f];
return t !== "none" ? parseInt(t.match(/(-?[0-9]+)/g)[5], 10) * -1 : 0
}}}, u = {position: {setLeft: function(e, t) {
e.css("left", t)
},setTop: function(e, t) {
e.css("top", t)
}},transform: {setPosition: function(e, t, n, r, i) {
e[0].style[f] = "translate3d(" + (t - n) + "px, " + (r - i) + "px, 0)"
}}}, a = function() {
var t = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/, n = e("script")[0].style, r = "", i;
for (i in n)
if (t.test(i)) {
r = i.match(t)[0];
break
}
return "WebkitOpacity" in n && (r = "Webkit"), "KhtmlOpacity" in n && (r = "Khtml"), function(e) {
return r + (r.length > 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e)
}
}(), f = a("transform"), l = e("<div />").css("background-position-x") !== r, c = l ? function(e, t, n) {
e.css({"background-position-x": t,"background-position-y": n})
} : function(e, t, n) {
e.css("background-position", t + " " + n)
}, h = l ? function(e) {
return [e.css("background-position-x"), e.css("background-position-y")]
} : function(e) {
return e.css("background-position").split(" ")
}, p = t.requestAnimationFrame || t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || t.oRequestAnimationFrame || t.msRequestAnimationFrame || function(e) {
setTimeout(e, 1e3 / 60)
};
d.prototype = {init: function() {
this.options.name = i + "_" + Math.floor(Math.random() * 1e9), this._defineElements(), this._defineGetters(), this._defineSetters(), this._handleWindowLoadAndResize(), this._detectViewport(), this.refresh({firstLoad: !0}), this.options.scrollProperty === "scroll" ? this._handleScrollEvent() : this._startAnimationLoop()
后面还有 125 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。