diff options
| author | Mark Otto <[email protected]> | 2011-09-10 22:31:55 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2011-09-10 22:31:55 -0700 |
| commit | 3755ee158f947bdb1d44b86faa9537ac9f3cbbc5 (patch) | |
| tree | 9c3e0d0b59c07068f2c210eab1262f2d664ab77d /docs/assets | |
| parent | 40693f261838136499b11c728e5389815e3ee322 (diff) | |
| parent | 709789d16dccc9c812b62e8d22c61d7f4748e9e2 (diff) | |
| download | bootstrap-3755ee158f947bdb1d44b86faa9537ac9f3cbbc5.tar.xz bootstrap-3755ee158f947bdb1d44b86faa9537ac9f3cbbc5.zip | |
Merge branch '1.3-wip' of github.com:twitter/bootstrap into 1.3-wip
Diffstat (limited to 'docs/assets')
| -rw-r--r-- | docs/assets/js/application-scrollspy.js | 39 | ||||
| -rw-r--r-- | docs/assets/js/application.js | 6 |
2 files changed, 6 insertions, 39 deletions
diff --git a/docs/assets/js/application-scrollspy.js b/docs/assets/js/application-scrollspy.js deleted file mode 100644 index 1f0b7cebe..000000000 --- a/docs/assets/js/application-scrollspy.js +++ /dev/null @@ -1,39 +0,0 @@ -// scroll spy logic -// ================ -$(function () { - - var activeTarget, - position = {}, - $window = $(window), - nav = $('body > .topbar li a'), - targets = nav.map(function () { - return $(this).attr('href'); - }), - offsets = $.map(targets, function (id) { - return $(id).offset().top; - }); - - function setButton(id) { - nav.parent("li").removeClass('active'); - $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); - } - - function processScroll(e) { - var scrollTop = $window.scrollTop() + 10, i; - for (i = offsets.length; i--;) { - if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { - activeTarget = targets[i]; - setButton(activeTarget); - } - } - } - - nav.click(function () { - processScroll(); - }); - - processScroll(); - - $window.scroll(processScroll); - -})
\ No newline at end of file diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 86eefa89d..d1c6751ea 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -6,6 +6,12 @@ $(document).ready(function(){ $('body').dropdown() // catch any dropdowns on the page + // Scrollspy + // ========= + + $('body > .topbar').scrollSpy() + + // table sort example // ================== |
