2012-06-26 3 views
0

jpeg 웹 사이트에서 jquery 스크롤 텍스트를 구현했습니다. 나는 텍스트에 여전히 스크롤 텍스트 BAS를 할 때 마우스를 통해 확인해야합니다 본문 섹션jquery scoll 텍스트를 마우스 위로 올려야합니다.

<div class="jp-title"> 

    <ul> 
    <li class="scrollingtext" > 

    <a href="index" >welcome </span> 

    </li> 
    </ul> 

</div> 

내에서 내 코드

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script> 
<script type="text/javascript"> 
    $(document).ready(function() { 

     $('.scrollingtext').bind('marquee', function() { 
      var ob = $(this); 
      var tw = ob.width(); 
      var ww = ob.parent().width(); 
      ob.css({ left: -tw }); 
      ob.animate({ left: ww }, 20000, 'linear', function() { 
       ob.trigger('marquee'); 
      }); 
     }).trigger('marquee'); 

    }); 
    </script> 

참조하십시오. 그러나 나는 어떻게 몰라?

답변

0

당신과 같이, 애니메이션을 중지 scrollingtext 요소에 mouseenter 또는 hover 이벤트 바인딩 할 수 있습니다

$(".scrollingtext").bind("mouseenter", function() { 
    $(this).stop(); 
}); 

나는 마우스가 잎 후 다시 시작하려는 같은데요를 스크롤링. 사용해보기 :

$(".scrollingtext").bind("hover", function() { 
    // equivalent to mouseenter. stop() stops all animation 
    $(this).stop(); 
}, function() { 
    // equivalent to mouseleave. this triggers your already existing 'marquee' event 
    $(this).trigger("marquee"); 
}); 
관련 문제