Template:Team:KIT-Kyoto/hp

From 2014.igem.org

(Difference between revisions)
Line 2: Line 2:
<script type="text/javascript">
<script type="text/javascript">
$(function(){
$(function(){
-
$(document).ready(function(){
 
-
    function showHeight(ele, w) {
 
-
      $(".windowsize").text("The height for the " + ele +
 
-
                    " is " + w + "px.");
 
-
}
 
-
    $("#getw").click(function () {
 
-
      showHeight("window", $("#picbox").width());
 
-
    });
 
-
});
 
$(".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);
Line 22: Line 13:
var checkpbw = function(){
var checkpbw = function(){
var pbw = $("#container").width();
var pbw = $("#container").width();
-
if(pbw <= 1158){
+
if(pbw >= 1158){
 +
$("#picbox").css({"width":"810px"});
 +
}else if(pbw >=569){
$("#picbox").css({"width":"540px"});
$("#picbox").css({"width":"540px"});
}else {
}else {
-
$("#picbox").css({"width":"810px"});
+
$("#picbox").css({"width":"270px"});
-
}
+
};
};
Line 35: Line 27:
var picbox = $("#picbox").width();
var picbox = $("#picbox").width();
var picw = 809;
var picw = 809;
 +
var mpicw = 569;
var loop = setInterval(function() {
var loop = setInterval(function() {
     var clone = $(".pic1 li:first").clone(true);
     var clone = $(".pic1 li:first").clone(true);
     if(picbox >= picw){
     if(picbox >= picw){
     $(".pic1 li:nth-child(4)").css({opacity:"0"});
     $(".pic1 li:nth-child(4)").css({opacity:"0"});
 +
    }else if(picbox >= mpicw){
 +
    $(".pic1 li:nth-child(3)").css({opacity:"0"});
     }else {
     }else {
-
    $(".pic1 li:nth-child(3)").css({opacity:"0"});
+
    $(".pic1 li:nth-child(2)").css({opacity:"0"});
     }
     }
     $(".pic1 li:first").animate({
     $(".pic1 li:first").animate({
Line 50: Line 45:
     $(".pic1 li:nth-child(4)").animate({opacity:"1"},1200);
     $(".pic1 li:nth-child(4)").animate({opacity:"1"},1200);
     }
     }
-
     else {
+
     else if(picbox >= mpicw){
     $(".pic1 li:nth-child(3)").animate({opacity:"1"},1200);
     $(".pic1 li:nth-child(3)").animate({opacity:"1"},1200);
 +
    }else {
 +
    $(".pic1 li:nth-child(2)").css({opacity:"0"});
     }
     }
         $(".pic1 li:first").remove();
         $(".pic1 li:first").remove();
Line 64: Line 61:
     if(picbox >= picw){
     if(picbox >= picw){
     $(".pic2 li:nth-child(4)").css({opacity:"0"});
     $(".pic2 li:nth-child(4)").css({opacity:"0"});
-
     }else {
+
     } if(picbox >= mpicw){
     $(".pic2 li:nth-child(3)").css({opacity:"0"});
     $(".pic2 li:nth-child(3)").css({opacity:"0"});
 +
    }else {
 +
    $(".pic2 li:nth-child(2)").css({opacity:"0"});
     }
     }
     $(".pic2 li:first").animate({
     $(".pic2 li:first").animate({
Line 75: Line 74:
     $(".pic2 li:nth-child(4)").animate({opacity:"1"},1200);
     $(".pic2 li:nth-child(4)").animate({opacity:"1"},1200);
     }
     }
-
     else {
+
     else (picbox >= mpicw){
     $(".pic2 li:nth-child(3)").animate({opacity:"1"},1200);
     $(".pic2 li:nth-child(3)").animate({opacity:"1"},1200);
 +
    }else {
 +
    $(".pic2 li:nth-child(2)").css({opacity:"0"});
     }
     }
         $(".pic2 li:first").remove();
         $(".pic2 li:first").remove();

Revision as of 19:30, 26 September 2014