Template:Team:KIT-Kyoto/hp
From 2014.igem.org
(Difference between revisions)
(22 intermediate revisions not shown) | |||
Line 4: | Line 4: | ||
$(".hp_img_link a").hover(function(){ | $(".hp_img_link a").hover(function(){ | ||
var hpnum = $(".hp_img_link a").index(this); | var hpnum = $(".hp_img_link a").index(this); | ||
- | $(".hp_img").eq(hpnum).stop().animate({"width":"100px","height":"100px","margin-left":"-22px","margin-top":"-30px"},100,'linear').css({"border-radius":"100px","-webkit-border-radius":"100px","-moz-border-radius":"100px"}); | + | $(".hp_img").eq(hpnum).stop(true,false).animate({"width":"100px","height":"100px","margin-left":"-22px","margin-top":"-30px"},100,'linear').css({"border-radius":"100px","-webkit-border-radius":"100px","-moz-border-radius":"100px"}); |
}, | }, | ||
function(){ | function(){ | ||
var hpnum = $(".hp_img_link a").index(this); | var hpnum = $(".hp_img_link a").index(this); | ||
- | $(".hp_img").eq(hpnum).stop().animate({"width":"60px","height":"60px","margin-left":"-2px","margin-top":"-10px"},100,'linear').css({"border-radius":"60px","-webkit-border-radius":"60px","-moz-border-radius":"60px"}); | + | $(".hp_img").eq(hpnum).stop(true,false).animate({"width":"60px","height":"60px","margin-left":"-2px","margin-top":"-10px"},100,'linear').css({"border-radius":"60px","-webkit-border-radius":"60px","-moz-border-radius":"60px"}); |
}); | }); | ||
}); | }); | ||
Line 33: | Line 33: | ||
var stopfunc = $("#stop").hasClass("stop"); | var stopfunc = $("#stop").hasClass("stop"); | ||
if(stopfunc){ | if(stopfunc){ | ||
- | clearInterval( | + | clearInterval(loop1); |
- | clearInterval( | + | clearInterval(loop2); |
+ | clearInterval(loop3); | ||
$("#stop").removeClass('stop'); | $("#stop").removeClass('stop'); | ||
+ | $("#stop a").css("background-image","url(/wiki/images/0/0c/Kit_Play.png)"); | ||
}else { | }else { | ||
- | loop1 = setInterval(slide1, | + | loop1 = setInterval(slide1,5000); |
- | loop2 = setInterval(slide2, | + | loop2 = setInterval(slide2,5000); |
- | $("#stop").addClass(' | + | loop3 = setInterval(slide3,5000); |
+ | $("#stop").addClass('stop'); | ||
+ | $("#stop a").css("background-image","url(/wiki/images/9/90/Kit_Pause.png)"); | ||
} | } | ||
}); | }); | ||
+ | $("#stop a").hover(function(){ | ||
+ | $("#stop a").stop().animate({opacity:"0.7"},400); | ||
+ | }, | ||
+ | function(){ | ||
+ | $("#stop a").stop().animate({opacity:"1"},400); | ||
+ | } | ||
+ | ); | ||
var picbox = $("#picbox").width(); | var picbox = $("#picbox").width(); | ||
var picw = 809; | var picw = 809; | ||
var mpicw = 569; | var mpicw = 569; | ||
- | var loop1 = setInterval(slide1, | + | var loop1 = setInterval(slide1,5000); |
function slide1() { | function slide1() { | ||
var clone = $(".pic1 li:first").clone(true); | var clone = $(".pic1 li:first").clone(true); | ||
Line 76: | Line 87: | ||
- | var loop2 = setInterval(slide2, | + | var loop2 = setInterval(slide2,5000); |
function slide2() { | function slide2() { | ||
var clone = $(".pic2 li:first").clone(true); | var clone = $(".pic2 li:first").clone(true); | ||
Line 103: | Line 114: | ||
}); | }); | ||
} | } | ||
+ | |||
+ | var loop3 = setInterval(slide3,5000); | ||
+ | function slide3() { | ||
+ | var clone = $(".pic3 li:first").clone(true); | ||
+ | if(picbox >= picw){ | ||
+ | $(".pic3 li:nth-child(4)").css({opacity:"0"}); | ||
+ | }else if(picbox >= mpicw){ | ||
+ | $(".pic3 li:nth-child(3)").css({opacity:"0"}); | ||
+ | }else { | ||
+ | $(".pic3 li:nth-child(2)").css({opacity:"0"}); | ||
+ | } | ||
+ | $(".pic3 li:first").animate({ | ||
+ | marginRight : "-270px",opacity:"0" | ||
+ | }, { | ||
+ | duration : 800, | ||
+ | complete : function() { | ||
+ | if(picbox >= picw){ | ||
+ | $(".pic3 li:nth-child(4)").animate({opacity:"1"},1200); | ||
+ | } | ||
+ | else if(picbox >= mpicw){ | ||
+ | $(".pic3 li:nth-child(3)").animate({opacity:"1"},1200); | ||
+ | }else { | ||
+ | $(".pic3 li:nth-child(2)").animate({opacity:"1"},1200); | ||
+ | } | ||
+ | $(".pic3 li:first").remove(); | ||
+ | clone.clone(true).insertAfter($(".pic3 li:last")); | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | |||
}); | }); | ||
Line 172: | Line 213: | ||
} | } | ||
- | .pic1,.pic2{ | + | .pic1,.pic2,.pic3{ |
list-style: none; | list-style: none; | ||
width:100%; | width:100%; | ||
Line 181: | Line 222: | ||
} | } | ||
- | .pic1{ | + | .pic1,.pic3{ |
margin:10px 0px; | margin:10px 0px; | ||
} | } | ||
Line 188: | Line 229: | ||
margin:10px 5px 10px 0px; | margin:10px 5px 10px 0px; | ||
} | } | ||
- | .pic1 img{ | + | .pic1 img,.pic3 img{ |
width:260px; | width:260px; | ||
float:right; | float:right; | ||
Line 208: | Line 249: | ||
#stop a{ | #stop a{ | ||
display:block; | display:block; | ||
- | + | background-image:url(/wiki/images/9/90/Kit_Pause.png); | |
- | + | background-size:25px 25px; | |
+ | width:25px; | ||
+ | height:25px; | ||
+ | } | ||
+ | |||
+ | #stop span{ | ||
+ | visibility:hidden; | ||
+ | } | ||
+ | @media screen and (max-width: 568px) { | ||
+ | #stop{ | ||
+ | right:-10px; | ||
+ | bottom:10px; | ||
+ | } | ||
} | } | ||
</style> | </style> |
Latest revision as of 13:10, 1 October 2014