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

Creating a vertical accordion menu using Panel controls

This example demonstrates sliding animation with Panel controls. We will create a vertical accordion menu that allows only one main menu item to be expanded at a time. The constructs used in this example are as follows:

Construct

Type

Description

$("#identifier")

jQuery selector

This selects an element using its ID.

$(".class")

jQuery selector

This matches all elements with the specified CSS class.

$(this)

jQuery object

This refers to the current jQuery object.

click

jQuery event

This is fired when you click on an element. It corresponds to the JavaScript click event.

event.stopPropagation()

jQuery method

This stops an event from bubbling up the DOM tree.

.find() ...

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