选取框停止onload [英] marquee stop onload

查看:82
本文介绍了选取框停止onload的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

愚蠢的问题,但我尝试过和没有JavaScript,我似乎无法停止默认情况下的跑马灯。



基本上我想他们开始移动,但默认情况下停止。



我试过这样的东西:

  $每个($( 'tracks_marquee。'),函数(){$(本).stop();})。 //触发$ .b 

behavior =alternate
scrolldelay =160
onmouseover =this。开始();
onmouseout =this.stop();
onload =this.stop();>
这里有些文字
< / marquee>

但没有任何作用

解决方案

试试这个

 < marquee class =tracks_marqueebehavior =alternatescrollamount =0 > 
这里有些文字
< / marquee>



$(document).ready(function()
{
$(。tracks_marquee)。hover

函数()
{
$(this).attr(scrollamount,1);
$(this).start();
},
函数()
{
$(this).attr(scrollamount,0);
$(this).stop();
}

))

检查此活在小提琴中



http://jsfiddle.net/BM2Cq/


silly question, but I've tried with and without javascript, and I don't seem to be able to stop the marquees by default.

Basically I want them to start moving on mousover, but to be stopped by default.

I've tried stuff like this:

$.each($('.tracks_marquee'),function(){$(this).stop();}); //triggered on $.ready

<marquee class="tracks_marquee"
behavior="alternate"
scrolldelay="160"
onmouseover="this.start();"
onmouseout="this.stop();"
onload="this.stop();">
  some text here
</marquee>

but nothing works

解决方案

Try this

<marquee class="tracks_marquee" behavior="alternate" scrollamount="0"  >
  some text here
</marquee>



   $(document).ready(function()
{
$(".tracks_marquee").hover
  (
    function()
    {
       $(this).attr("scrollamount","1");
       $(this).start();  
    },
    function()
    {
       $(this).attr("scrollamount","0");
       $(this).stop();
    }
  )
})

Check this live in fiddle

http://jsfiddle.net/BM2Cq/

这篇关于选取框停止onload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆