views:

65

answers:

2

Hi

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

A: 

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. E.g.:

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

Serkan
could you please give me the complete code. I am the beginner in jquery. what will i put instead of #element. my marguee id is m_id.
Testadmin
Are you using the marquee html-tag or a jQuery animation?
Serkan
marquee tag. i am interested in jquery. But i don't know that code.
Testadmin
Updated my code.
Serkan
again thanks . But not working that code for me
Testadmin
+1  A: 

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