{"action":"created","issue":{"url":"https://api.github.com/repos/uikit/uikit/issues/1288","labels_url":"https://api.github.com/repos/uikit/uikit/issues/1288/labels{/name}","comments_url":"https://api.github.com/repos/uikit/uikit/issues/1288/comments","events_url":"https://api.github.com/repos/uikit/uikit/issues/1288/events","html_url":"https://github.com/uikit/uikit/issues/1288","id":79582393,"number":1288,"title":"Custom scroll observer for elements","user":{"login":"zslabs","id":1018402,"avatar_url":"https://avatars.githubusercontent.com/u/1018402?v=3","gravatar_id":"","url":"https://api.github.com/users/zslabs","html_url":"https://github.com/zslabs","followers_url":"https://api.github.com/users/zslabs/followers","following_url":"https://api.github.com/users/zslabs/following{/other_user}","gists_url":"https://api.github.com/users/zslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/zslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zslabs/subscriptions","organizations_url":"https://api.github.com/users/zslabs/orgs","repos_url":"https://api.github.com/users/zslabs/repos","events_url":"https://api.github.com/users/zslabs/events{/privacy}","received_events_url":"https://api.github.com/users/zslabs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/uikit/uikit/labels/feature","name":"feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-22T19:40:13Z","updated_at":"2015-05-27T17:30:53Z","closed_at":null,"body":"I noticed UIkit has a custom scroll observer on the document that fires the `scrolling.uk.document` selector -- it'd be great if we could hook into this for elements that we're trying to listen for scroll events on (that have overflows) so we can take advantage of the memory advantages of what we have in the core. This is what I'm having to do currently:\r\n\r\n    scrollTimeout = null\r\n    $('.js-hero-view__sidebar, .js-map-view__results').scroll ->\r\n      if !scrollTimeout\r\n        scrollTimeout = setTimeout((->\r\n          console.log 'scrolled'\r\n          clearTimeout scrollTimeout\r\n          scrollTimeout = null\r\n          return\r\n        ), 500)\r\n      return\r\n\r\nNot terrible... but also would rather not attach anything to `scroll()`"},"comment":{"url":"https://api.github.com/repos/uikit/uikit/issues/comments/106005535","html_url":"https://github.com/uikit/uikit/issues/1288#issuecomment-106005535","issue_url":"https://api.github.com/repos/uikit/uikit/issues/1288","id":106005535,"user":{"login":"zslabs","id":1018402,"avatar_url":"https://avatars.githubusercontent.com/u/1018402?v=3","gravatar_id":"","url":"https://api.github.com/users/zslabs","html_url":"https://github.com/zslabs","followers_url":"https://api.github.com/users/zslabs/followers","following_url":"https://api.github.com/users/zslabs/following{/other_user}","gists_url":"https://api.github.com/users/zslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/zslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zslabs/subscriptions","organizations_url":"https://api.github.com/users/zslabs/orgs","repos_url":"https://api.github.com/users/zslabs/repos","events_url":"https://api.github.com/users/zslabs/events{/privacy}","received_events_url":"https://api.github.com/users/zslabs/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T17:30:53Z","updated_at":"2015-05-27T17:30:53Z","body":"Wonder if we should also start looking into using requestAnimationFrame as described in http://www.html5rocks.com/en/tutorials/speed/animations/"}}