02.06.2015 Views

Bootstrap Tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Options<br />

Options can be passed via data attributes or JavaScript. Following table lists the options:<br />

Option<br />

Name<br />

Type/Default<br />

Value<br />

Data attribute<br />

name<br />

Description<br />

Offset<br />

Methods<br />

number<br />

Default: 10<br />

data-offset<br />

Pixels to offset from top when calculating position of<br />

scroll.<br />

.scrollspy('refresh'): When calling the scrollspy via the JavaScript method, you need to call the .refreshmethod to<br />

update the DOM. This is helpful if any elements of the DOM have changed i.e if you have added or removed some<br />

elements. Following would be the syntax to use this method.<br />

$('[data-spy="scroll"]').each(function () {<br />

var $spy = $(this).scrollspy('refresh')<br />

})<br />

EXAMPLE<br />

Following example demonstrates the use of.scrollspy('refresh') method:<br />

<br />

<br />

<br />

Toggle navigation<br />

<br />

<br />

<br />

<br />

<strong>Tutorial</strong> Name<br />

<br />

<br />

<br />

iOS<br />

SVN<br />

<br />

Java<br />

TUTORIALS POINT<br />

Simply Easy Learning

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

Saved successfully!

Ooh no, something went wrong!