Becuase that’s not what you.

 
Szychowski: Cork we already established that.

Szychowski: There was some confusion about wtf was going on :

Eisenmenger: Yea, that’s why I’m using jQuery .scroll to listen and .scrollTop to grab the offset

Goldberger: Use waypoints if you cant figure it out yourself

Szychowski: Btw you want ot be careful with scroll event listeners.

Goldberger: Or what was that popular lib called

Eisenmenger: I use debounce to reduce the amount of times it runs the function robertmaxrees

Eisenmenger: It’s a function in underscore to prevent the function from running a billion times lol

Goldberger: Debounce just masks a badly performing function tho

Eisenmenger: If that wasn’t the most affirmative thing I’ve ever said on discussion I’ll be damned

Szychowski: I still default to using one.

Eisenmenger: I would too for scroll event, it might just be a badly performing function but that may be the best option as far as I can tell

Goldberger: I’m inclined to link my 6000 div lookup script

Szychowski: Why not fix the perf AND use a debounce? Shrug the world may never know.

Eisenmenger: I think I’ve seen this decx haha, I’ve been ‘roun these parts before

Eisenmenger: The performance? I was just going to use a low debounce

Goldberger: For posterity https://jsfiddle.net/decx/z95roz0r/2/

Eisenmenger: Hmm that’s not the one I saw a while back, you’ve done quite a few of these thousand element fiddles decx?

Eisenmenger: I used to remember you being a great help a couple of years ago when I was just starting on this journey towards jQuery enlightenment

Szychowski: True jquery enlightenment is know when to not use it.

Goldberger: I reached enlightenment with css

Goldberger: Box-shadow: 0 0 15px yellow

Eisenmenger: Yea absolutely robertmaxrees

Hank: Btw as a continuation, they are specing media queries for scroll position :

Goldberger: Just for above fold or active in viewport like my attempt

Goldberger: I remember hearing about it years ago

Eisenmenger: I didn’t reach enlightenment I just moved to back end ;-

Hosterman: Anyone know why .html is returning false?

Szychowski: Have an example of that happening?

Nachmias: Does closest return outside a span block as well?

Goldberger: Html never returns false specifically, it either returns a string or undefined

Szychowski: Https://jsfiddle.net/Szychowski/qnn9xkyd/

Cherchio: Yeah it is returning specifically undefined

Goldberger: Then your selector is wrong

Szychowski: Because you selector isn’t matching anything.

Szychowski: Undefined and false are different fwiw.

Szychowski: I’ll bet your .closest isn’t doing what you think it is.

Sevadjian: Szychowski: ill bet that as well

Kermes: Var test = $e.target.closest’div.grab_container’.html;

Zahri: Console.logtest = undefined

Eisenmenger: I’ll bet that as well

Lorent: Does that look correct?

Szychowski: I’d have to see your html.

Vallier: A cl***=”trigger” div cl***=”grab_container”/div

Szychowski: So the div is inside the a?

Szychowski: Closest searches ancestors

Boocock: A cl***=”trigger”/a div cl***=”grab_container”/div

Szychowski: You want a sibling of the link.

Szychowski: Https://api.jquery.com/siblings/

Szychowski: Yes, it goes through an element’s ancestors.

Vivas: How do i get the closest below?

Szychowski: Becuase that’s not what you want here.