/** * $.yx_rotaion * @charset utf-8 * @extends jquery.1.8.3 * @fileOverview 创建图片轮播 * @author 天涯浅唱 * @email 122452357@qq.com * @site wwww.webchao.com * @version 0.1 * @date 2013-05-21 * Copyright (c) 2013-2013 天涯浅唱 * @example * $("a").yx_rotaion(); */ (function($){ $.fn.extend({ yx_rotaion: function(options) { //默认参数 var defaults = { /**轮换间隔时间,单位毫秒*/ during:3000, /**是否显示左右按钮*/ btn:true, /**是否显示焦点按钮*/ focus:true, /**是否显示标题*/ title:true, /**是否自动播放*/ auto:true } var options = $.extend(defaults, options); return this.each(function(){ var o = options; var curr_index = 0; var $this = $(this); var $li = $this.find("li"); var li_count = $li.length; $this.css({position:'relative',width:$li.find("img").width(),height:$li.find("img").height()}); $this.find("li").css({position:'absolute',left:0,top:0}).hide(); $li.first().show(); $this.append('