Chapter 7 jQuery and the Web Browser
Disabling the right-click contextual menu
Using JavaScript, you can disable the browser’s native right-click contextual menu. Doing so
with jQuery is a snap. We simply cancel the contenxtmenu event.
Sample: sample80.html
Scrolling the browser window
While there are numerous plugins for scrolling the browser window, doing so can be trivial when
a simple scroll is required. By setting the scrollTop CSS property on the and
elements, it is possible to control the position of the horizontal or vertical scrolling. In the code
below, I use the animate() method to animate the horizontal scrolling to a specific element in
the page.
Sample: sample81.html