WebRoot/static/os/js/jump.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

function JumpObj(elem, range, startFunc, endFunc) {
	var curMax = range = range || 6;
	startFunc = startFunc || function() {};
	endFunc = endFunc || function() {};
	var drct = 0;
	var step = 1;

	init();

	function init() {
		elem.style.position = 'relative';active()
	}
	function active() {
		elem.onmouseover = function(e) {
			if (!drct) jump()
		}
	}
	function deactive() {
		elem.onmouseover = null
	}

	function jump() {
		var t = parseInt(elem.style.top);
		if (!drct) motionStart();else {
			var nextTop = t - step * drct;
			if (nextTop >= -curMax && nextTop <= 0)
				elem.style.top = nextTop + 'px';
			else if (nextTop < -curMax)
				drct = -1;else {
				var nextMax = curMax / 2;
				if (nextMax < 1) {
					motionOver();return;
				}
				curMax = nextMax;
				drct = 1;
			}
		}
		setTimeout(function() {
			jump()
		}, 200 / (curMax + 3) + drct * 3);
	}
	function motionStart() {
		startFunc.apply(this);
		elem.style.top = '0';
		drct = 1;
	}
	function motionOver() {
		endFunc.apply(this);
		curMax = range;
		drct = 0;
		elem.style.top = '0';
	}

	this.jump = jump;
	this.active = active;
	this.deactive = deactive;
}

$(function() {
	$("#J_homePromo .home-promo-list img").each(function(k, img) {
后面还有 5 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。