简体   繁体   中英

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. 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


On mouseover/mouseout event:

<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? Therefore you could call the stop()-function when the window fires an scroll-event. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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