jQuery 이미지 티켓M스터 처럼된?...
[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]
개코딩이므로...이해부탁드립니다.
<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개
뜨거운형제들
10년 전
뭐가 다르냐면요..
왼쪽 끝과 오른쪽 끝이 살짝 보이는 느낌...네..그런느낌입니다.
왼쪽 끝과 오른쪽 끝이 살짝 보이는 느낌...네..그런느낌입니다.
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 3년 전 | 4402 | ||
| 474 | 10년 전 | 6583 | ||
| 473 | 10년 전 | 5044 | ||
| 472 | 10년 전 | 5584 | ||
| 471 | 10년 전 | 8273 | ||
| 470 | 10년 전 | 6894 | ||
| 469 |
|
10년 전 | 6057 | |
| 468 |
|
10년 전 | 7996 | |
| 467 | 10년 전 | 8729 | ||
| 466 |
|
10년 전 | 7379 | |
| 465 |
carlpark
|
10년 전 | 9952 | |
| 464 | 10년 전 | 5083 | ||
| 463 |
잘살아보자
|
10년 전 | 12312 | |
| 462 | 10년 전 | 10804 | ||
| 461 | 10년 전 | 6373 | ||
| 460 |
|
10년 전 | 8707 | |
| 459 | 10년 전 | 5757 | ||
| 458 |
잘살아보자
|
10년 전 | 5566 | |
| 457 |
잘살아보자
|
10년 전 | 9316 | |
| 456 | 10년 전 | 8060 | ||
| 455 | 10년 전 | 9034 | ||
| 454 | 10년 전 | 9752 | ||
| 453 | 10년 전 | 11439 | ||
| 452 | 10년 전 | 7430 | ||
| 451 | 10년 전 | 54862 | ||
| 450 | 10년 전 | 4971 | ||
| 449 | 10년 전 | 9983 | ||
| 448 | 10년 전 | 9497 | ||
| 447 | 10년 전 | 9115 | ||
| 446 | 10년 전 | 7112 | ||
| 445 | 10년 전 | 17319 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기