Skip to content

Instantly share code, notes, and snippets.

@haknick
Created May 24, 2017 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haknick/0b1007455f7b698ac67961f733331a00 to your computer and use it in GitHub Desktop.
Save haknick/0b1007455f7b698ac67961f733331a00 to your computer and use it in GitHub Desktop.
var getSEOByPosition = function(scrollTop, headerOffset) {
//--------------------
onsole.log('LENGTH', sections.length);
/* for (var i=0; i<sections.length; i++) {
// if position is above or below nav sections then set the activeSection to null
if (t <= sections[0][1] - headerOffset ) {
for(var j=0; j<seo.length; j++) {
if($('body').hasClass('page-'+seo[j].id)) {
activeSection = seo[j];
break;
}
}
} else if (t >= sections[i][1] - headerOffset) {
for(var k=0; k<seo.length; k++) {
if( seo[k].id === sections[i][0] ) {
activeSection = seo[k];
break;
}
}
} else {
break;
}
} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment