aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-scrollspy.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2012-07-22 18:28:39 -0700
committerJacob Thornton <[email protected]>2012-07-22 18:28:39 -0700
commitdcf75697ecd243517b23d8ef440f772d91f699c0 (patch)
treef0bd9a5a2bd9c0e8a2dd09ceb4606009c5051181 /js/bootstrap-scrollspy.js
parentfa1e1e34dfd9e8501ffdbb92a282ff5550685f3c (diff)
downloadbootstrap-dcf75697ecd243517b23d8ef440f772d91f699c0.tar.xz
bootstrap-dcf75697ecd243517b23d8ef440f772d91f699c0.zip
some progress on affix plugin
Diffstat (limited to 'js/bootstrap-scrollspy.js')
-rw-r--r--js/bootstrap-scrollspy.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js
index 4416d2168..e90cdccb9 100644
--- a/js/bootstrap-scrollspy.js
+++ b/js/bootstrap-scrollspy.js
@@ -23,15 +23,15 @@
"use strict"; // jshint ;_;
- /* SCROLLSPY CLASS DEFINITION
- * ========================== */
+ /* SCROLLSPY CLASS DEFINITION
+ * ========================== */
- function ScrollSpy( element, options) {
+ function ScrollSpy(element, options) {
var process = $.proxy(this.process, this)
, $element = $(element).is('body') ? $(window) : $(element)
, href
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
- this.$scrollElement = $element.on('scroll.scroll.data-api', process)
+ this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
this.selector = (this.options.target
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|| '') + ' .nav li > a'
@@ -121,7 +121,7 @@
/* SCROLLSPY PLUGIN DEFINITION
* =========================== */
- $.fn.scrollspy = function ( option ) {
+ $.fn.scrollspy = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('scrollspy')
@@ -141,7 +141,7 @@
/* SCROLLSPY DATA-API
* ================== */
- $(function () {
+ $(window).on('load', function () {
$('[data-spy="scroll"]').each(function () {
var $spy = $(this)
$spy.scrollspy($spy.data())