This repository has been archived by the owner on Mar 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deselect all if no target is in view
- Loading branch information
Emre Koc
committed
Jun 9, 2017
1 parent
becf68a
commit 5592575
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* navigate.js | ||
* Animated navigation on one-pagers using anchors. | ||
* | ||
* @version 1.0.5 | ||
* @version 1.0.6 | ||
* @author Emre Koc <[email protected]> | ||
*/ | ||
'use strict'; | ||
|
@@ -117,11 +117,13 @@ function resizeCalculate() { | |
function scroll() { | ||
if (!animating) { | ||
var i = void 0, | ||
b = void 0, | ||
item = void 0, | ||
top = $window.scrollTop() + changePoint; | ||
for (i = items.length - 1; i >= 0; i--) { | ||
item = items[i]; | ||
if (item.top <= top) { | ||
b = true; | ||
if (hash != item.id) { | ||
if (options.history) { | ||
change(item.hash, true); | ||
|
@@ -132,6 +134,14 @@ function scroll() { | |
break; | ||
} | ||
} | ||
|
||
if (!b) { | ||
if (hash) { | ||
change('#', true); | ||
} else { | ||
select(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters