curIdx;
if(winPos + this.winHeight === this.docHeight){ curIdx = this.points.length - 1; }
- else if(winPos < this.points[0]){ curIdx = 0; }
+ else if(winPos < this.points[0]){ curIdx = undefined; }
else{
var isDown = this.scrollPos < winPos,
_this = this,
this.$active = this.$links.filter('[href="#' + this.$targets.eq(curIdx).data('magellan-target') + '"]').addClass(this.options.activeClass);
if(this.options.deepLinking){
- var hash = this.$active[0].getAttribute('href');
+ var hash = " ";
+ if(curIdx != undefined){
+ hash = this.$active[0].getAttribute('href');
+ }
if(window.history.pushState){
window.history.pushState(null, null, hash);
}else{