简体   繁体   English

滚动条中带有动画文字

[英]animated text with in a scroll bar

I have implemented a scroll bar with in table column. 我已经在表格列中实现了一个滚动条。 Here i want to scroll the text like marquee. 在这里,我想滚动显示字幕。 I placed the content with in that scroll div. 我将内容放在该滚动div中。 But my problem is that . 但是我的问题是。 i want to stop the marquee by clicking on the scroll bar. 我想通过单击滚动条来停止字幕。 simply 只是

when page load marquee(text move from bottom to the top)will be active when clicking or dragging the scroll bar marquee must be disappear( ie effect with out a marquee) 当单击或拖动滚动条时,页面加载字幕(文本从底部移动到顶部)将处于活动状态,字幕必须消失(即没有字幕的效果)

Does any one know this 有人知道吗

EDIT: If you are interested in jquery then look at this jQuery Marquee Plugin 编辑:如果您对jquery感兴趣,那么看看这个jQuery Marquee插件


On mouseover/mouseout event: mouseover / mouseout事件上:

<marquee onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 6, 0);">
your text here
</marquee>

On click event: 点击事件:

<marquee onclick="this.setAttribute('scrollamount', 0, 0);">
your text here
</marquee>

I am not sure if I did understand your question correctly. 我不确定我是否正确理解了您的问题。 But if I am right you want to stop an jQuery animation when the user scrolls the window? 但是,如果我是对的,那么您想在用户滚动窗口时停止jQuery动画吗? Therefore you could call the stop()-function when the window fires an scroll-event. 因此,当窗口触发滚动事件时,您可以调用stop()函数。 Eg: 例如:

$(document).ready(function(){
    $(window).scroll(function(){
        $('marquee').attr('scrollAmount', 0, 0);
    });
});

​ Updated version: Code to stop marquee on scrolling, but doesn't start again when scrolling is done. -来以上一回事:代码停止滚动字幕,但滚动完成后不会再次开始

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM