Crystal Xu (Talk | contribs) |
m |
||
Line 331: | Line 331: | ||
pictures = $(".slidePic"); | pictures = $(".slidePic"); | ||
− | if(pictures.eq(0).css("display") | + | if(pictures.eq(0).css("display") == "block"){ |
pictures.eq(0).css("display", "none"); | pictures.eq(0).css("display", "none"); | ||
pictures.eq(pictures.length-1).css("display", "block"); | pictures.eq(pictures.length-1).css("display", "block"); | ||
return; | return; | ||
− | } | + | } else{ |
− | + | for(i = 0; i < pictures.length; i++){ | |
− | + | if(pictures.eq(i).css("display") == "none"){ | |
− | + | continue; | |
− | + | } else{ | |
− | + | pictures.eq(i-1).css("display", "block"); | |
− | + | pictures.eq(i).css("display", "none"); | |
+ | return; | ||
+ | } | ||
} | } | ||
} | } | ||
Line 348: | Line 350: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
− | $(". | + | $(".slideButtRight").click(function(){ |
pictures = $(".slidePic"); | pictures = $(".slidePic"); | ||
− | if(pictures.eq(pictures.length-1).css("display") | + | if(pictures.eq(pictures.length-1).css("display") == "block"){ |
pictures.eq(pictures.lenght-1).css("display", "none"); | pictures.eq(pictures.lenght-1).css("display", "none"); | ||
pictures.eq(0).css("display", "block"); | pictures.eq(0).css("display", "block"); | ||
return; | return; | ||
− | } | + | } else{ |
− | + | for(i = 0; i < pictures.length; i++){ | |
− | + | if(pictures.eq(i).css("display") == "none"){ | |
− | + | continue; | |
− | + | } else{ | |
− | + | pictures.eq(i+1).css("display", "block"); | |
− | + | pictures.eq(i).css("display", "none"); | |
+ | return; | ||
+ | } | ||
} | } | ||
} | } |
Revision as of 19:35, 28 October 2017