Set marquee scrolling to default starting position

844 Views Asked by At

I have a continuous image scroll (marquee) in html. I want to create a marquee that should stop when mouse over event activated and the images should set to its starting position. on mouse out the marquee should have to start scrolling again.

How could i create it ? is there any methode in JQUERY?

1

There are 1 best solutions below

0
On

You haven't given much information to work with in your question, but fundamentally you'll probably want to hook the mouseenter and mouseleave events on the marquee. (jQuery provides them for browsers that don't support them natively.)

$("selector for the marquee")
    .mouseenter(function() {
        // stop the marquee, set the element positions as you want them
    })
    .mouseleave(function() {
        // restart it
    });