grapdew님의 슬라이드 최근게시물 자동슬라이드 질문입니다ㅠ > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

grapdew님의 슬라이드 최근게시물 자동슬라이드 질문입니다ㅠ 정보

grapdew님의 슬라이드 최근게시물 자동슬라이드 질문입니다ㅠ

본문

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=115284&sca=&sfl=mb_id%2C1&stx=sckshine
여기의 grapdew님 최근게시물을 이용하고 있는데요.

자동슬라이드가 처음에는 안되고 좌우 클릭을 한번 해야 자동슬라이드가 되네요.
의도적인 부분인거 같은데 자바스크립트는 초보라서 이렇게 도움을 청해봅니다.
이소스에서 어딜 고쳐야 처음부터 자동슬라이드가 될까요?ㅠ

-------------------
<script>
/*
rolling page by hong..
*/
var leftCt = 0;
$(function(){
$("#album").attr("top", "0");
imgStart("R");
});
function imgStart(tp){
clearInterval($("#imgList").attr("timer"));
if(tp == "R"){ // 오른쪽 이동
imgRight();
$("#imgList").attr("timer", setInterval("imgRight()", 3000)); // 멈춰있는 시간
}else{ // 왼쪽이동
if(leftCt == 0){
var leng = $("#imgList div").size();
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
leftCt = 1;
}
imgLeft();
$("#imgList").attr("timer", setInterval("imgLeft()", 3000));
}
}
function imgRight(){
$("#imgList").animate({
left : parseInt($("#imgList div").eq(0).width() * -1)
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList>div").eq(0).clone().appendTo($("#imgList"));
$("#imgList>div").eq(0).remove();
});
}
function imgLeft(){
var leng = $("#imgList div").size();
$("#imgList").animate({
left : 0
},300,function(){
$("#imgList").css("left", "0px");
$("#imgList").css("left",parseInt($("#imgList div").eq(0).width()*-1));
$("#imgList>div").eq(parseInt(leng-1)).clone().prependTo($("#imgList"));
$("#imgList>div").eq(leng).remove();
});
}
</script>
<style>
/*
이미지 사이즈 맞춰서 수정해주세요... (#viewArea)
*/
#back {position:relative; width:330px; height:120px; border:#e2e6e9 0px solid;}
#viewArea {position:relative; width:270px; height:100px; overflow:hidden; left:28px; top:18px;}
#imgList {position:absolute; width:800px; left:0px; top:0px;}
#imgList div {float:left; padding:0px; }
#btnLeft {position:absolute; left:10px; float:left; z-index:10; top:60px; cursor:hand;}
#btnRight {position:absolute; right:10px; float:right; z-index:10; top:60px; cursor:hand;}
</style>
<div id="back">
<div id="viewArea">
<div id="imgList">
    <? for ($i=0; $i<count($list); $i++) {

$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
?>
<div><a href="<?=$list[$i]['href']?>"><img src='<?=$img?>' width="270" height="100" border="0"></a></div>
    <? } ?>
</div>   
</div>
<div id="btnLeft">
<span onClick="imgStart('L')"><img src='<?=$latest_skin_path?>/img/btn_left.gif' border="0" align=absmiddle></span>
</div>
<div id="btnRight">
<span onClick="imgStart('R')"><img src='<?=$latest_skin_path?>/img/btn_right.gif' border="0" align=absmiddle></span>
</div>
</div>

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT