0
votes

I want to scroll down the page when I drag over my div so,

 $('#scroll-handle-down').on('dragover', function () {

    console.log('we hovered');
    $('html, body').animate({
        scrollTop: height
    }, 10000);
});
$('#scroll-handle-down').on('dragleave', function () {
    console.log("left")
    $('html, body').stop().animate();
});

in drag over I am setting scroll animation, but when I get out of that div, its keep on scrolling,

I want to stop scrolling when I am not over the particular div.

how can I stop that scroll animation in my dragleave event?

1

1 Answers

0
votes

use

 $('html, body').stop();

Or

 $('html, body').animate().stop();