Timeline for jQuery cookie scroll position
Current License: CC BY-SA 3.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2020 at 13:24 | history | edited | CommunityBot |
Commonmark migration
|
|
Apr 13, 2017 at 12:40 | history | edited | CommunityBot |
replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
|
|
Aug 3, 2015 at 21:32 | comment | added | Ismael Miguel | @Pevara I had no idea of the name, but at the time I didn't remembered of it. I know it is quite used and I've used it myself a few times before. Thank you for the reminder. I'm sure I can use it somewhere again. | |
Aug 3, 2015 at 21:30 | comment | added | Pevara | Much better! Not something I invented btw, it's a well known technique called Debouncing, it is even build right into popular js toolboxes like underscore.js | |
Aug 3, 2015 at 20:50 | comment | added | Ismael Miguel | @Pevara Fixed it! Hope it is what you meant (or better). | |
Aug 3, 2015 at 20:49 | history | edited | Ismael Miguel | CC BY-SA 3.0 |
Refactored the answer based on Pevara suggestion, fixed spelling mistakes
|
Aug 3, 2015 at 20:33 | comment | added | Ismael Miguel |
@Pevara I see what you mean with the clearTimeout . That would be a great idea! Only write the cookie if you want n milliseconds. That really is amazing! I will look into it in 10 minutes (I'm eating now)
|
|
Aug 3, 2015 at 20:19 | comment | added | Pevara |
While I basically agree with your answer, and believe a debounce function should definitely be used here, yours is missing a (critical!) clearTimeout as far as I can tell. Not much debouncing going on here, just a little delay before you start writing cookies like crazy. Also 10ms is hardly a delay... I would at least go for 250ms here
|
|
Jul 4, 2015 at 19:47 | history | answered | Ismael Miguel | CC BY-SA 3.0 |