테스트 사이트 - 개발 중인 베타 버전입니다

jQuery 이미지 티켓M스터 처럼된?...

· 10년 전 · 6056 · 1
이미지 4.png
[code]

<style>
.RollTest { position:relative; overflow:hidden; z-index:10; min-width:990px; height:345px; background-color:#cfcfcf; }
.RollTest div.RollTestLeft { position:absolute; z-index:20; left:20px; top:50%; margin:-33px 0 0 0; width:66px; height:67px; background-image:url('./img/new/newheader.png'); background-position:-153px 0; text-indent:-9999px; }
.RollTest div.RollTestRight { position:absolute; z-index:20; right:20px; top:50%; margin:-33px 0 0 0; width:66px; height:67px; background-image:url('./img/new/newheader.png'); background-position:-153px -67px; text-indent:-9999px; }
.RollTest ul { margin:0; padding:0; position:absolute; top:27px; left:50%; }
.RollTest ul li { width:322px; height:297px; float:left; position:relative; list-style-type:none; }
</style>

<div class="RollTest">
<div class="RollTestLeft">왼쪽</div>
<div class="RollTestRight">오른쪽으로</div>
<ul>
<li><img src="./img/new/11.png" alt=""/></li>
<li><img src="./img/new/22.png" alt=""/></li>
<li><img src="./img/new/33.png" alt=""/></li>
<li><img src="./img/new/55.png" alt=""/></li>
<li><img src="./img/new/66.png" alt=""/></li>
<li><img src="./img/new/77.png" alt=""/></li>
<li><img src="./img/new/88.png" alt=""/></li>
<li><img src="./img/new/99.png" alt=""/></li>
<li><img src="./img/new/1010.png" alt=""/></li>
</ul>
</div>

<script type="text/javascript">
var RollWidth = 322;
var RollLength = $(".RollTest > ul > li").length;
var RollSL = Number(RollLength)*RollWidth;

$(".RollTest ul").width(RollSL).css("margin-left","-"+RollSL/2+"px");
$(".RollTestLeft").click(function(){
$("<li>"+$(".RollTest ul li").eq(RollLength-1).html()+"</li>").prependTo(".RollTest ul");
$(".RollTest ul li:last").remove();
$(".RollTest ul").hide().fadeIn(300);
});
$(".RollTestRight").click(function(){
$("<li>"+$(".RollTest ul li").eq(0).html()+"</li>").appendTo(".RollTest ul:last");
$(".RollTest ul li").eq(0).remove();
$(".RollTest ul").hide().fadeIn(300);
});
</script>

[/code]

개코딩이므로...이해부탁드립니다.

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

뭐가 다르냐면요..
왼쪽 끝과 오른쪽 끝이 살짝 보이는 느낌...네..그런느낌입니다.

게시판 목록

그누보드5 팁자료실

글쓰기
🐛 버그신고