Geeky Ninja Geeky Ninja - 3 months ago 16
HTML Question

Stop Vertical Scrolling on right click using Jquery

In my application when user presses right click I display some options to user and when user clicks on any option like copy page is scroll to top always.

I just need to stop the page scrolling.

I have tried to use animate method of jQuery, but this is not working.

$('html,body').animate({
scrollTop: $('#CopyImage').offset().top
}, 0);

Answer

Probably you copy option is a element like that:

<a href='#' >copy</a>

just replace # with javascript: void 0;