From 2014hs.igem.org
(Difference between revisions)
|
|
Line 69: |
Line 69: |
| }); | | }); |
| /*自动切换*/ | | /*自动切换*/ |
- | $(".slider-scroll").hover(function(){ | + | |
- | clearInterval($picTimer);
| + | |
- | },function(){
| + | |
- | $picTimer = setInterval(function() {
| + | |
- | if(index==$len-1)
| + | |
- | {
| + | |
- | index=0;
| + | |
- | }
| + | |
- | else
| + | |
- | {
| + | |
- | index+=1;
| + | |
- | }
| + | |
- | $("#"+$objId).find("ul li").removeClass("on");
| + | |
- | $("#"+$objId).find("ul li").eq(index).addClass("on");
| + | |
- | $("#"+$showArea).find("img").css({"display":"none","opacity":"0.3"});
| + | |
- | $("#"+$showArea).find("img").eq(index).css({"display":"block"}).stop(true,false).animate({"opacity":"1"},500);
| + | |
- | },opts.interval); // 自动播放的间隔,单位:毫秒
| + | |
- | }).trigger("mouseleave");
| + | |
- | function showimg(index)
| + | |
- | {
| + | |
- | if(index==$len)
| + | |
- | {
| + | |
- | index=0;
| + | |
- | }
| + | |
- | $("#"+$objId).find("ul li").removeClass("on");
| + | |
- | $("#"+$objId).find("ul li").eq(index).addClass("on");
| + | |
- | $("#"+$showArea).find("img").css({"display":"none","opacity":"0.3"});
| + | |
- | $("#"+$showArea).find("img").eq(index).css({"display":"block"}).stop(true,false).animate({"opacity":"1"},500);
| + | |
- | index+=1;
| + | |
- | }
| + | |
- | }
| + | |
| }); | | }); |
| </script> | | </script> |
Revision as of 02:17, 20 June 2014
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
响应式图片切换jQuery选项卡