64x64 icon dark hosting
Choose a hosting plan here and get a free year's subscription to Tuts+ (worth $180).
Advertisement

jQuery Succinctly: jQuery and the Web Browser

by
Gift

Start a hosting plan from $3.92/mo and get a free year on Tuts+ (normally $180)

This post is part of a series called jQuery Succinctly.
jQuery Succinctly: Events & jQuery
jQuery Succinctly: jQuery Plugins

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.


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 <html> and <body> 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.

Advertisement