<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script> function change(type){ var parent=$('span#roll'); var first=$('span#roll>ul').first(); var last=$('span#roll>ul').last(); if(type=='next'){ first.css('display','none'); parent.append(first); $('span#roll>ul').first().css('display','block'); } else if(type=='prev'){ first.css('display','none'); parent.prepend(last); $('span#roll>ul').first().css('display','block'); } } </script> <div align="center" style="height:200px;margin-left:130px"> <span id="roll"> <ul style="list-style:none;"> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/22017C385166BF161F" width="300px" name="1"></li> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/144694475176A0B914" width="300px" name="2"></li> </ul> <ul style="display:none;list-style:none"> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/227DC63B5166BC0B2B" width="300px" name="3"></li> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/0147B438516424D60D" width="300px" name="4"></li> </ul> <ul style="display:none;list-style:none"> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/247590355164241439" width="300px" name="5"></li> <li style="float:left"><img src="https://t1.daumcdn.net/cfile/tistory/161F10415164235C24" width="300px" name="6"></li> </ul> </span> </div> <a href="javascript:change('prev')" style="margin-left:425px">prev</a><a href="javascript:change('next')" style="margin-left:37px">next</a> |
'Web Programings > J-Query' 카테고리의 다른 글
[J-Query] 함수 및 키워드 등 (0) | 2013.06.13 |
---|---|
[J-Query] jquery 애니메이션이 완전히 끝난 후에 다음 동작 적용 (0) | 2013.01.29 |
[J-Query] checkbox의 여러 값을 가져오기 (0) | 2013.01.17 |
[J-Query] 간단한 J쿼리 (0) | 2012.08.09 |
[JavaScript] html의 input type의 속성값을 J-Query로 가져오기 (4) | 2012.07.23 |