Skilful act jQuery tips and tricks

jQuery is a JavaScript library which is simple, light-weight, open source, cross browser and simplifies animations, event handling, and developing Ajax-based web applications and promotes rapid application development. Here are few jQuery tips: Check Element Exists if ($(“#element”).length) { … } Check Element Is Visible if($(“#element”).is(“:visible”) == “true”) { … } Disable Right Mouse Click […]

jQuery live() Method

The jQuery live method attach one or more event handlers for all elements which match the current selector and specifies a function to run when the events occur. Event handlers attached using live() method works for both current and future elements which match the selector. Syntax of jQuery live(): $(selector).live(event, data, function) Note: The jQuery […]

Using Delegate and Undelegate in jQuery

Using delegate and undelegate in jQuery, you can bind or remove a handler from the event for all elements that matches the current selector. Basically, these methods achieve the same thing as the jQuery .live() and .die() methods but they just use a different syntax. Syntax of Delegate: $(selector).delegate(childSelector,event,data,function) Example of jQuery Delegate: $(“table”).delegate(“td”, “hover”, […]