O'Reilly logo

ASP.NET jQuery Cookbook - Second Edition by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding actions to plugins

In this example, let's create a plugin that can perform more than one action by taking in the desired action as an argument. The programming constructs used in this example are summarized as follows:

Construct

Type

Description

$("#identifier")

jQuery selector

This selects an element based on its ID

$(this)

jQuery object

This refers to the current jQuery object

$.extend()

jQuery function

This merges the contents of two or more objects into the first object

.animate()

jQuery method

This performs a custom animation on the specified CSS properties

.css()

jQuery method

This gets the style property for the first matched element or sets the style property for every matched element

.each()

jQuery ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required