Skip to content

Instantly share code, notes, and snippets.

@haknick
Created May 24, 2017 16:41
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/84c40df21fda6eeb0f7a86371675c178 to your computer and use it in GitHub Desktop.
Save haknick/84c40df21fda6eeb0f7a86371675c178 to your computer and use it in GitHub Desktop.
const sections = data.triggerPoints;
const seo = data.seo;
//const activeSection = [];
t = scrollTop+ headerOffset;
if (t < sections[0][1])
return R.find((_seo) => $('body').hasClass(_seo.id), seo);
var hasSEO = (_id) => R.find((_seo) =>_seo.id==_id, seo) != undefined;
const sectionAfterT = R.filter((_section) => (t <= _section[1]), sections);
const firstMatchTriggerPoint = R.find((_section) => hasSEO(_section[0]), sectionAfterT);
return R.find((_seo)=>_seo.id==firstMatchTriggerPoint[0], seo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment