2014-03-27 94 views
1
 <marquee direction="up" scrollamount=2 id="whatshappening"> 
    <ul> 
     <li class="Whats-Happening-row" > 
     <p class="Donationmade"><span></span><a href="#">Ravi Donated for Storm in Bangalore</a></p> 
     <p class="underlinewhatsHappening"></p> 
     </li> 
     <li class="Whats-Happening-row "> 
     <p class="Donationmade"><span></span><a href="#">Ravi Donated for Storm in Bangalore</a></p> 
     <p class="underlinewhatsHappening"></p> 
     </li> 
    </ul> 
     </marquee> 

嗨PPL,选框移动应该在鼠标悬停时停止并开始休假?

我用一个简单的字幕移动我的文字upwards.when它是移动的每个标签里所有的李应停止转动,由于该链接可以查看onmouseover和当我鼠标在它之外,它应该继续向上移动。你能否告诉我如何继续使用JQUERY? 。 在此先感谢。

+0

重复的http://stackoverflow.com/questions/22655738/how-to-stop-marquee-slide-show-on-mouse-over-in-javascript – KunJ

回答

1

停止标签试试这个

<marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();">Puting mouse over me</marquee> 
2

使用onmouseover="this.stop();"onmouseout="this.start();"

<marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();">code here</marquee> 

Working Demo

1

您可以使用scrollAmount = 0这样的伎俩。它将移动

<marquee onmouseover="this.scrollAmount = 0;" onmouseout="this.scrollAmount = 2" direction="up" scrollamount=2 id="whatshappening"> 

Demo

0

选取框鼠标悬停已经在Firefox,因为被打破:V27 链接:bugzilla.mozilla.org/show_bug .cgi?id = 984040 所以大多数建议的修补程序都无济于事。 在这里找到了答案,但它打破了一切: 链接:support.mozilla.org/en-US/questions/987386 虽然我磕磕绊绊我在一起修复了当前版本的ff,即chrome。 这里是的jsfiddle: http://jsfiddle.net/atlbike/9snwd6ga/8/

 <marquee id="myMarquee" onMouseOver="this.setAttribute('scrollamount', 0, 0);" OnMouseOut="this.setAttribute('scrollamount', 2, 0);" >Hello Go on... hover over me!</marquee> 

jQuery的例子:

$("#myMarquee").mouseenter(function(){ 
    document.getElementById("myMarquee").stop(); 
}); 
$("#myMarquee").mouseleave(function(){ 
    document.getElementById("myMarquee").start(); 
}); 

基本上,我发现jQuery的要求停止使用了Mozilla网站修复时/启动会的工作。 我还必须修复忽略动态缩放的最近的Chrome缺陷。我很快就会把我的博客放在我的博客上。你可以在这里看到修复:atlbike.org 不知道这些链接是否可以在这里工作,不记得我是否曾经在这里发布过? HTH

1
<script type="text/javascript"> 
     var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; 
     // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) 
     var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ 
     var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; 
     // At least Safari 3+: "[object HTMLElementConstructor]" 
     var isChrome = !!window.chrome && !isOpera; // Chrome 1+ 
     var isIE = /*@[email protected]*/false || !!document.documentMode; // At least IE6 
     function MarqueStart() { 

      if (isChrome) { 
       mrq.start(); 

      } 
      else { 
       mrq.setAttribute('scrollamount', 0, 0); 

      } 
     } 
     function MarqueStop() { 
      if (isChrome) { 
       mrq.stop(); 
      } 
      else { 
       mrq.setAttribute('scrollamount', 2, 0); 
      } 
     } 


    </script> 
相关问题