슬라이드 마우스오버시 슬라이드 정지

슬라이드 마우스오버시 슬라이드 정지

QA

슬라이드 마우스오버시 슬라이드 정지

본문

$(function(){
 n=1  
 $('.btn1').addClass('active') 
 
 $('').mouseover(function(){
  n+=1 /*--1씩 증가--*/
  if(n==5){ /*--6번째가 될 때에는 (n=11로 돌아감)--*/
   n=1
  }
  $('.gallery li').fadeOut()//hide()
  $('.img'+n).fadeIn()//show()
  
  $('.btngrp   li').removeClass('active')
  $('.btn'+n).addClass('active')
 })//next End 
  
 $('').mouseover(function(){
  n-=1
  if(n==0){
   n=4 /*--3장일 때는 3--*/
  }
  $('.gallery li').fadeOut()//hide()
  $('.img'+n).fadeIn()//show()
  
  $('.btngrp   li').removeClass('active')
  $('.btn'+n).addClass('active')
 })//prev End
 
 $('.btngrp   li').mouseover(function(){
  n = parseInt($(this).attr('data-n'))
  $('.gallery li').fadeOut(-10000)//hide()(이미지넘어가는시간)
  $('.img'+ n).fadeIn(-10000)//show() (이미지넘어가는시간)
  $('.btngrp   li').removeClass('active')
  $('.btn'+ n ).addClass('active')
 })
    
  
       
        setInterval(function runslide() {  
            n+=1
   if(n==5){
    n=1
   }
   $('.gallery li').fadeOut(-20000)//hide() /*--2000은 2초--*/ (이미지넘어가는 시간)
   $('.img'+n).fadeIn(-10000)//show() (이미지넘어가는시간)
   
   
   
   $('.btngrp   li').removeClass('active')
   $('.btn'+n).addClass('active')
           

         }, 6000); //(이미지가멈춰있는시간)
 

 $('.btngrp .btn1').click(function(){
  $('.box_01').animate({'bottom':0})
 })
 
 $('.btngrp01 .btn2').click(function(){
  $('.box_01').animate({'bottom':-460})
  })
  
 $('.btngrp01 .btn3').click(function(){
  $('.box_01').animate({'bottom':-920})
  })

 $('.btngrp01 .btn4').click(function(){
  $('.box_01').animate({'bottom':-1840})
  })


})







여기서 어떤 것을 수정하거나 추가해야

마우스 오버 시 슬라이드 이미지가 멈추는지 알려주세요 ㅠㅠ

검색해봐도 모르겠네요 ㅠㅠ​ 

이 질문에 댓글 쓰기 :

답변 2

다음의 코드를 추가하면 되지 않을까 합니다.


$('.gallery li').mouseover(function(){ // 슬라이드 이미지 마우스 오버시

clearInterval(runslide); // 자동 이동 멈춤

});

답변을 작성하시기 전에 로그인 해주세요.
전체 14
QA 내용 검색

회원로그인

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