02.06.2015 Views

Bootstrap Tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Option<br />

Name<br />

Type/Default<br />

Value<br />

Data<br />

attribute<br />

name<br />

Description<br />

backdrop<br />

boolean or the<br />

string 'static'<br />

Default: true<br />

databackdrop<br />

specify static for a backdrop, if you don’t want the modal to be closed<br />

when the user clicks outside of the modal.<br />

keyboard<br />

boolean<br />

Default: true<br />

datakeyboard<br />

Closes the modal when escape key is pressed; set to false to disable.<br />

show<br />

boolean<br />

Default: true<br />

data-show<br />

Shows the modal when initialized.<br />

remote<br />

path<br />

Default: false<br />

data-remote<br />

Using the jQuery .load method, inject content into the modal body. If<br />

an href with a valid URL is added, it will load that content. An example<br />

of this is shown below:<br />

Click<br />

me<br />

METHODS<br />

The following are some useful methods which can be used with modal().<br />

Method Description Example<br />

Options:.modal(options)<br />

Activates your content as a modal. Accepts<br />

an optional options object.<br />

$('#identifier').modal({<br />

keyboard: false<br />

})<br />

Toggle:.modal('toggle') Manually toggles a modal $('#identifier').modal('toggle')<br />

Show:.modal('show') Manually opens a modal $('#identifier').modal('show')<br />

Hide:.modal('hide') Manually hides a modal $('#identifier').modal('hide')<br />

EXAMPLE<br />

The following example demonstrates the usage of methods:<br />

Example of using methods of Modal Plugin<br />

<br />

<br />

Launch demo modal<br />

<br />

<br />

<br />

<br />

<br />

<br />

×<br />

TUTORIALS POINT<br />

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!