<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
;(function($){

	/**
	* @Author:Shixian Zheng
	* @Name:slider
	* @CurrentVersion: v1.2 
	* @Email:qiubi8801@163.com
	* @Date:2013-08-02
	* @Hostory: v1.0 åŽŸå§‹ç‰ˆæœ¬
	*			v1.1 æ”¯æŒjQçš„é“¾å¼æ“ä½œ
				v1.2 è§£å†³å†’æ³¡é—®é¢˜
	* @How to use: $('selector').slider();
	*/

	$.fn.slider = function(options){

		var defaults = {
			ChangeTime : 3000,
			FadeinTime : 500,
			PicDes : 'show',
			IndexBtn : 'show',
			CurClass : 'current'
		};

		var ops = $.extend(defaults, options);
		
		return this.each(function(){
			var box = $(this);
			var _index = 0;
			var _myTimer;

			if(ops.PicDes == 'show'){
				var strFirstPic = $('ul li',box).eq(0).find('img').attr('alt');
				var picDesHtml = $('&lt;div class="des"&gt;' + strFirstPic + '&lt;/div&gt;&lt;div class="des_bg"&gt;&lt;/div&gt;');
				box.append(picDesHtml);
			};
			
			if(ops.IndexBtn == 'show'){
				var arr = [];
					arr.push('&lt;dl&gt;')
					for(i = 1; i &lt;= $('li',this).length; i++){
						arr.push('&lt;dd&gt;' +  i + '&lt;/dd&gt;');
					};
					arr.push('&lt;/dl&gt;');
				var _IndexBtnHtml = $(arr.join(''));
				$(this).append(_IndexBtnHtml);

				$('dl dd',box).mouseenter(function(){
					$(this).addClass(ops.CurClass).siblings().removeClass(ops.CurClass);
					$('ul li',box).eq($(this).index()).fadeIn().siblings().hide();
					if(ops.PicDes == 'show'){
						var strAlt = $('ul li',box).eq($(this).index()).find('img').attr('alt');
						$('.des').text(strAlt);
					};
					clearTimeout(_myTimer);
				}).mouseleave(function(){
					_index = $(this).index();
					autoPlay();
				});

				$('ul li',box).mouseenter(function(){
					clearTimeout(_myTimer);
				}).mouseleave(function(){
					_index = $('.current',box).index();
					autoPlay();
				});
			};

			var autoPlay = function(){
				$('dl dd',box).eq(_index).addClass(ops.CurClass).siblings().removeClass(ops.CurClass);
				$('ul li',box).eq(_index).fadeIn(ops.FadeinTime).siblings().hide();		
				if(ops.PicDes == 'show' ){
					var strAlt = $('ul li',box).eq(_index).find('img').attr('alt');
					$('.des').text(strAlt);
				};
				_index = _index &gt;= $('ul li',box).length - 1 ? 0 : ++_index;
				_myTimer = setTimeout(autoPlay,ops.ChangeTime);
			};

			autoPlay();
		});
	};
})(jQuery); </pre></body></html>