Layout Options

  • Fixed Header
    Makes the header top fixed, always visible!
  • Fixed Sidebar
    Makes the sidebar left fixed, always visible!
Introduction
Webconcept

Description

The click event occurs when an element is clicked.

The click() method triggers the click event, or specifies a function to run when a click event occur.


Trigger the Event

Trigger the click event for the selected elements.


v1.0

This method has the form:

.click()

Return Value

This form returns a jQuery object.


Bind a Function to the Event

Specifies a function to run when the click event occurs for the selected element.

v1.0

This method has the alternate form:

.click(function)
Parameter Description
function (optional) Specifies the function to run when the click event occurs

Return Value

This form returns a jQuery object.


v1.4.3

This method has the alternate form:

.click(data,function)
Parameter Description
data (optional) Specifies additional data to pass along to the function
function (optional) Specifies the function to run when the click event occurs

Return Value

This form returns a jQuery object.

Examples

Hide or show a p element when a button is clicked:

$("button").click(function(){
  $("p").slideToggle();
});

Description

The dblclick event occurs when an element is double-clicked.

The dblclick() method triggers the dblclick event, or specifies a function to run when a dblclick event occur.

Tip: The dblclick and click events can cause problems if they are applied to the same element.


Trigger the Event

Trigger the dblclick event for the selected elements.

v1.0

This method has the form:

.dblclick()

Return Value

This form returns a jQuery object.


Bind a Function to the Event

Specifies a function to run when the dblclick event occurs for the selected element.

v1.0

This method has the alternate form:

.dblclick(function)
Parameter Description
function (optional) Specifies the function to run when the dblclick event occurs

Return Value

This form returns a jQuery object.


v1.4.3

This method has the alternate form:

.dblclick(data,function)
Parameter Description
data (optional) Specifies additional data to pass along to the function
function (optional) Specifies the function to run when the dblclick event occurs

Return Value

This form returns a jQuery object.

Examples

Hide or show a p element when a button is double-clicked:

$("button").dblclick(function(){
  $("p").slideToggle();
});