Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Add property active to settings object
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximum Hallinan committed Mar 6, 2015
1 parent 15dc32c commit 9894d85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scrollTrigger.js
Expand Up @@ -6,7 +6,8 @@

var settings = $.extend({
offset: 60,
target: this
target: this,
active: 'scrolltrig--active'
}, options),
el = this;

Expand All @@ -19,15 +20,15 @@

if(settings.target != el) {
if(sT > $(el[0]).offset().top - wH + settings.offset) {
$(settings.target).addClass('active');
$(settings.target).addClass(settings.active);
} else {
$(settings.target).removeClass('active');
$(settings.target).removeClass(settings.active);
}
} else {
if(sT > $(v).offset().top - wH + settings.offset) {
$(v).addClass('active');
$(v).addClass(settings.active);
} else {
$(v).removeClass('active');
$(v).removeClass(settings.active);
}
}

Expand Down

0 comments on commit 9894d85

Please sign in to comment.