I use the following formula.

Hammrich: History state is for session stuff, I’ve only seen it used to track things like scroll position

Wenig: If you want people to be able to link to the state, you put the data in the url and read from the url

Defusco: RequestAnimationFrame can be a bit intense – what’s an easy way to limit how many calls this makes? Make a counter variable with ifcounter % val or something or is there a different approach?

Suchocki: GetBoundingClientRect returns an object with left/top values that appear to work as long as the page has not scrolled. As soon as the page has been scrolled down, the values start to not match up, increasingly more and more the more you scroll. How can I account for that?

Vancampen: GreenJello, thanks it works perfectly

Defusco: GreenJello: just that sometimes I don’t think I need request to be requesting quite so much for what i’m doing, so it’d be cool to limit that a bit

Tidrington: Undrinkablesoup, maybe you want el.offsetTop/offsetLeft ?

Shymske: Baxx, so you want to throttle http requests?

Fallis: Http://jsfiddle.net/jyoticharan/r4AGd/6/ could someone guide. thanks

Fallis: I want it in pure javascript only. thanks.

Volz: Smgs, start by looking up the syntax for a “for loop”

Defusco: GreenJello: I dunno I guess so, just so that if it’s currently refreshing 40 times a second I could change that to 10 or whatever just to make it a bit easier on the processer or whatnot

Fallis: GreenJello: https://jsfiddle.net/d03px1ut/ could you help with this.

Gavia: Baxx, underscore/lodash has a function called throttle that lets you say “don’t run this more than every 100ms”

Fallis: I just want to test if it can be done in pure javascript or not. thanks

Defusco: GreenJello: I’m not using and libraries at the mo – I’m only doing something really basic for learning so it’s nothing that has to be releasable or whatever

Warneke: Throttle is the simplest way to solve that

Defusco: GreenJello: oh ok cool, didn’t mean to be obtuse :

Pachelo: You could write it yourself if you like

Defusco: GreenJello: if it’s simple then yeah, but this was just something that I thought might make sense and maybe commonly done, I guess you’ve answer ‘yes, with throttle though’ ha

Defusco: I’m a bit confused about why I’m getting only a small box on this that refreshes : https://jsfiddle.net/9scf62kh/

Defusco: You can move the ball with the arrow keys – but it can only move a bit

Leazer: Good morning folks. I posted a question on so about inheritance issue. This is the code that was given to. It works. However, I don’t know if it’s a good solution or if there is a nicer way – http://jsfiddle.net/dqggvjrj/

Seybert: Zumba_addict what was the question this is solving?

Bastos: This is what I posted last night – http://stackoverflow.com/questions/32643167/advanced-javascript-inheritance-is-failing-parent-parent-child

Blumer: Yeah, that’s pretty much how you do it

Smolic: Or use es6 cl***es if you can

Sharkey: My question would be, when do you need inheriting in javascript?

Jover: Yansanmo, clearly for implementing people

Mckirgan: Can you use composition instead?

Bermers: I would like to see a website with that modal

Inzunza: I was wondering why he had to prototype the method. Why did he not add the method at first?

Bruins: Acmello, there’s no real code there, so you can’t really say if it’s good or bad or how you’d do “it” in other ways

Spirk: Because there’s no “it”

Dyck: Btw, what does this do? Cl***A.callthis;

Weinstock: GreenJello: offsetTop seems to increase even if the page has not been scrolled.

Holderby: GreenJello, I’m saying it’s a better solution, just saying there’re other different ways to deal situations where inheritance my be suitable :

Hanses: I use the following formula to calculate the Y position of the object: rectObject.top + theElement.offsetTop