<div class="codetitle"> <span><a style="CURSOR: pointer" data="67132" class="copybut" id="copybut67132" onclick="doCopy('code67132')"><u>コードをコピーします</u></a></span> コードは次のとおりです:</div> <div class="codebody" id="code67132"> <br><script type="text/javascript" src= "script/jquery-1.7.2.min.js"><BR><script type="text/javascript"><BR>$(function() { <BR>var page = 1; <BR>var i = 1; <BR>var conheight = $('.con li').height(); <BR>var lilen = $('li').length; Math.ceil ( lilen / i ); <BR>alert(conheight " " len);//alert("page:" ページ " i:" i " conheight:" conheight " lilen:" lilen " len: " len) <BR>$('.next').click(function() { <BR>if( page == len){ <BR>alert("操作できなくなりました!"); <BR>return false ; <BR>} <BR>$('.con_list').animate({top:'-=' conheight},'slow'); <BR>ページ ; <BR>//if( ページ == len ) { <BR>// $('.con_list').animate({top:0},'slow'); <BR>// ページ = 1 <BR>// }else{ <BR>// $ ( '.con_list').animate({top:'-=' conheight},'slow'); <BR>//} <BR>}); prev ').click(function() { <BR>if(page == 1){ <BR>alert("これで終わりで、これ以上の操作は実行できません!"); <BR>return false; <BR>} <BR>$ ('.con_list').animate({top:' =' conheight},'slow'); <BR>page--; <BR>//if( page == 1 ) { <BR>// $( '.con_list').animate({top:'-=' conheight*(len - 1)},'slow'); <BR>// ページ = <BR>//} else{ <BR>/ / $('.con_list').animate({top:' =' conheight},'slow'); <BR>// page--; ); <BR>} ) <BR></script> <br><style type="text/css"> <br>margin:0;padding:0 <br>} <br>.prev,. next{ <br>width:100px;height:20px;background:#333;cursor:pointer <br>} <br>.con{ <br>width:100px;height:300px;overflow: hidden;position:relative <br>} <br>.con_list{ <br>position:relative <br>} <br>.con li{ <br>height:100px <br>} <br>.one{ <br>background:#F90 <br>} <br>.two { <br>background:#69C <br>} <br>.three{ <br>background:#633 <br>} <br></style> ; <BR><本文><BR><div class="con"> > <br>< <br><li class="one">11111111111111111111</li> <br><li class="two">22222222222222222222</li> "3" >3333333333333333333<br><li class="three">44444444444444<br><li class="one">55555555555555 lt;/li><BR> <li class="two">666666666666666666</li><BR><li class="one">7777777777777777</li><BR><li class="two">8888888 8888 888888888</ li> <br> <li class="one">9999999999</li> <br></ul> ;/div><br><br><div class="next"> <br><br> </div> </li> </div>