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

슬라이드 마우스오버시 이미지 멈춤 채택완료

최오구 8년 전 조회 3,749

$(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})   })

})

마우스 오버시 슬라이드를 멈추게 하고 싶은데 뭘 추가해야 하나요??? ㅠㅠ

 

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

답변 1개

채택된 답변
+20 포인트
8년 전

code 태그로 감싸주시면 보기가 좀 편했을텐데 ㅜㅠ

일단은 현재 동작으로 봐선 마우스 오버시 setinterval 대신에 cleartimeout 을 사용하는건데

setinterval 을 변수로 할당해야 합니다.

일단 코드부터 좀 감싸주세요 ^^

로그인 후 평가할 수 있습니다

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

답변을 작성하려면 로그인이 필요합니다.

로그인