//————————
var text = function( now ){
values.cols.find(‘span’).css({ opacity:0 }).eq( now ).stop(true).delay(500).animate({ opacity:1 },1000);
values.cols.find(‘h3’).css({ opacity:0 }).eq( now ).stop(true).delay(500).animate({ opacity:1 },500);
values.cols.find(‘p’).css({ opacity:0 }).eq( now ).stop(true).delay(1000).animate({ opacity:1 },500);
}
//框架尺寸
//——————————-
$(window).resize(function(){
values.container.height( values.cols.find(‘img’).height() );
}).resize();
// 自动播放,degrees 方法获取对应参数,并且修改小按钮样式(如果有小按钮的话),然后刷新全局变量 values.now
// time: 延时时间
//———————
var loop,play = function( time ){
clearTimeout( loop );
loop = setTimeout(function(){
change();
play( 3000 );
}, time );
}
//暂停 和 触发自动播放
//———————
var control = function(){
values.container.hover(function(){
clearTimeout( loop );
},function(){
play( 2000 );
});
}
//初始化效果,调用各个函数
//——————–
var initialize = function(){
var now = values.now;
weaken( values.cols.length-1 ,now );
if(values.btns ) button();
if( values.pre && values.next ) shortcut();
btnStyle( now );
text( now );
play( 4000 );
control();
}
//初始化调用
//———————
initialize();
}
}
</pre><br>
<br>
<pre></pre>
<pre code_snippet_id=”280064″ snippet_file_name=”blog_20140408_2_455436″ name=”code” class=”html”></pre><pre code_snippet_id=”280064″ snippet_file_name=”blog_20140408_2_455436″ name=”code” class=”html”></pre>
<p></p>
<pre></pre>
</pre>










