Content/jqueryui/tests/visual/effects/scale.html

(开头部分) 3KB

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

<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>jQuery UI Effects Test Suite</title>
	<link rel="stylesheet" href="effects.css">
	<script src="../../../jquery-1.9.1.js"></script>
	<script src="../../../ui/jquery.ui.effect.js"></script>
	<script src="../../../ui/jquery.ui.effect-scale.js"></script>
	<script>
	$(function() {
		var test = $( "#testBox" ),
			opts = $( ".arg" ),
			optsRev = $( opts.get().reverse() ),
			doer = $( "#doAnim" ),
			current = $( "#current" ),
			cleanStyle = test[0].style,
			total = 1;

		opts.each(function() {
			total *= this.options.length;
		});

		opts.change( doAnim );
		doer.click( doAnim );
		$( "#cyclePrev" ).click(function() {
			cycle( -1 );
		});
		$( "#cycleNext" ).click(function() {
			cycle( 1 );
		});

		function cycle( direction ) {
			optsRev.each(function() {
				var cur = this.selectedIndex,
					next = cur + direction,
					len = this.options.length;

				this.selectedIndex = ( next + len ) % len;

				if ( ( next+len ) % len === next ) return false;
			});
			doAnim();
		}


		function doAnim() {
			var cur = 0;
			opts.each(function() {
				cur *= this.options.length
				cur += this.selectedIndex;
			});
			cur++;
			current.text( "Configuration: " + cur + " of " + total );
			run.apply(test, opts.map(function() {
				return $(this).val();
			}).get());
		}

		function run( position, v, h, vo, ho ) {
后面还有 97 行代码,解锁后查看完整代码

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

AI 解读

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

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