메뉴 건너뛰기

2016.12.22 20:26

흐르는 배너 만들기2

조회 수 8425 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
<style type="text/css">
*{margin:0;padding:0;}
ul, li{list-style:none;}
#recomPro{margin-bottom:40px;}
#recomPro > div.inner{width:1400px;margin:0 auto;}
#recomPro .slideWrap{position:relative;overflow:hidden;height:337px;margin-bottom:28px;}
#recomPro .slideWrap p.bg{position:absolute;top:33px;width:179px;height:324px;background:url("./images/bg_tic_01.png") no-repeat 0 0;}
#recomPro .slideWrap p.bg.side01{left:0px;}
#recomPro .slideWrap p.bg.side02{right:-3px;background:url("./images/bg_tic_02.png") no-repeat 0 0;}
#recomPro .slideWrap a.bxBtn{position:absolute;z-index:10;top:117px;margin:0;width:21px;height:39px;background:url("./images/btn_prev_01.png") no-repeat 0 0;text-indent:-9999px;}
#recomPro .slideWrap a.bxBtn.bx-prev{left:179px;}
#recomPro .slideWrap a.bxBtn.bx-next{left:auto;right:179px;background:url("./images/btn_next_01.png") no-repeat 0 0;}
#recomPro .tickerSlide{position:absolute;top:0px;left:0px;overflow:hidden;-webkit-transition-timing-function: linear; /* Safari and Chrome */transition-timing-function: linear;}
#recomPro .tickerSlide li{float:left;width:200px;padding:33px 0 0 0;}
#recomPro .tickerSlide li > a{display:block;}
#recomPro .tickerSlide li > a p.thum{text-align:center;margin:29px 0 15px 0;}
#recomPro .tickerSlide li > a p.thum img{width:140px;margin:0 auto;}
#recomPro .tickerSlide li > a p.txt{height:59px;padding:0 20px;font-size:13px;margin-bottom:12px;text-align:center;color:#424242;line-height:18px;overflow:hidden;}
#recomPro .tickerSlide li > a p.txt em{display:block;margin-bottom:5px;text-align:center;font-weight:bold;}
#recomPro .tickerSlide li > a p.price{font-family:Roboto;font-size:16px;color:#e5151a;font-weight:bold;text-align:center;}
#recomPro .tickerSlide li > a p.price del{display:block;color:#999;font-weight:normal;}
#recomPro .tickerSlide li > a p.price del span{font-size:18px;}
#recomPro .tickerSlide li > a p.price span.wp{color:#e5151a;font-size:22px;}
#recomPro .tickerSlide li > a p.price span.wp span.pr{font-size:22px;color:#e5151a;}
< /style>


< div class="recomPro" id="recomPro">
<div class="inner">
  <h3 class="titMain">Recommended PRODUCT</h3>
  <div class="slideWrap">
   <a href="#none" class="bxBtn bx-prev">이전</a>
   <ul class="tickerSlide" id="tickerSlide">
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>1[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>2[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>3[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>4[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>5[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>6[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>7[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
    <li>
     <a href="#">
      <p class="thum"><img src="./images/thum.gif" alt="" /></p>
      <p class="txt"><em>8[DIOR]</em>DIOR ADDICT LIP GLOW CORAL</p>
      <p class="price"><del><span class="pr">$</span>88</del><span class="wp"><span class="pr">$</span>56</span></p>
     </a>
    </li>
   </ul>
   <a href="#none" class="bxBtn bx-next">다음</a>
   <p class="bg side01">&nbsp;</p>
   <p class="bg side02">&nbsp;</p>
  </div>
</div>
< /div>
< !-- //recomPro e -->

< script type="text/javascript">
$(document).ready(function(){
var moveType = 0;
var moveSpeed = 2500;
//var moveWork = false;
var movePause = false;

function tkSlide(){ 
  var $tkSlide = $('#tickerSlide'),
   $tkSlidePos = $('#tickerSlide').css('left').replace(/[^-\d\.]/g, ''),
   $tkWidth = $('#tickerSlide').width(),
   $tklength = $('#tickerSlide li').length,
   $tkSlideW = $tkWidth + 400,
   $tkitemW = $('#tickerSlide li').width(),
   $tkitemFirst = $('#tickerSlide li:first-child');

  $tkSlide.css({
   'left' : $tkSlidePos,
   'width' : $tkWidth + $tkitemW
  });
  if(moveType==0){
   $tkSlide.css('left' ,$tkSlidePos);
   $tkSlide.animate({left : -$tkitemW},{duration:moveSpeed, easing:"linear", step:function(){
    if(movePause==true){
     $tkSlide.stop();
    }
   }, complete:function(){
    $tkSlide.append("<li>" + $('#tickerSlide li:first-child').html() + "</li>");
    $('#tickerSlide li:first-child').remove();
    $tkSlide.css('left' ,'0');
    tkSlide();
   }});
  }
}
$('#tickerSlide').parent().on("mouseenter", function(){
  movePause=true;
});
$('#tickerSlide').parent().on("mouseleave", function(){
  movePause=false;
  console.log('mouseleave');
  tkSlide();
});

$('.slideWrap >a.bxBtn').on('click', function(){
  var banMove = 5,
   $thisClass = $(this).hasClass("bx-prev");

  if($thisClass){
   var $tkSlide = $('#tickerSlide');
   for(var i=0;i<banMove;i++){   
    var $tkSlide = $('#tickerSlide'),   
     $tkitem = $('#tickerSlide li:last-child()').html();
    $('#tickerSlide li:first-child()').before("<li>" + $tkitem + "</li>");
    $('#tickerSlide li:last-child()').remove();
   }
   $tkSlide.css('left' ,'-200px');
   $tkSlide.animate({left : 0}, 500);
  } else {
   var $tkSlide = $('#tickerSlide');
   for(var i=0;i<banMove;i++){   
    var $tkSlide = $('#tickerSlide'),   
     $tkitem = $('#tickerSlide li:nth-child(1)').html();
    $tkSlide.append("<li>" + $tkitem + "</li>");
    $('#tickerSlide li:nth-child(1)').remove();
   }
   $tkSlide.css('left' ,0);
   $tkSlide.animate({left : -200}, 500);
  }
});
tkSlide();
< /script>

List of Articles
번호 제목 날짜 조회 수
59 하단 고정 레이어 스타일(CSS) 따라하기 2016.12.22 7833
58 항상 레이어가 정 가운데 위치하는 스크립트 2016.12.22 6967
57 scrolling to top 2016.12.22 6562
56 Ajax를 이용한 데이터 조회시 로딩 로딩 이미지 보이기(jquery이용) file 2016.12.22 10807
55 금액단위 제거 표기 2016.12.22 6283
54 시간 카운트 2016.12.22 7192
53 디자인 셀렉트 박스 & CSS 2016.12.22 6432
» 흐르는 배너 만들기2 2016.12.22 8425
51 bxslider 멈춤현상 2016.12.22 10379
50 jquery 플러그인 링크 모음 2016.12.22 49860
49 html 테이블 고정 (table fixed) 2016.11.18 7284
48 이미지 클릭 손 (cursor:pointer) 2016.11.18 7192
47 jQuery Selector (셀렉터) 2016.11.18 7018
46 날짜 검색 범위 정하기 (jquery) file 2016.11.17 7930
45 jQuery 날짜 비교 (날짜비교) 2016.11.17 10146
44 jQuery 카테고리 선택에 따른 하위 카테고리 변경 (selecbox) file 2016.11.17 8130
43 jquery radio checked (라디오 버튼 값으로 선택), 검색 조건 초기 셋팅 2016.11.17 10116
42 jquery 뒤로가기 2016.11.17 6576
41 jQuery tr 추가 (입력창 추가), jQuery 테이블 행 추가/삭제, selector last name 2016.11.17 8622
40 jQuery, JavaScript 새로고침(reload) 2016.11.17 7024
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved