7 ms·
Show HN: Stalker, a jQuery Plugin That Follows Users on a Page
- cleverjake 14y agothis is essentially built into css now, with position: sticky http://updates.html5rocks.com/2012/08/Stick-your-landings-position-sticky-lands-in-WebKit http://updates.html5rocks.com/2012/08/Stick-your-landings-po...
- rxooo 14y agoMy browser (chrome) doesn't support position: sticky so I guess the solution proposed is a lot better for compatibility.
- cleverjake 14y agooh for sure, and great job at it. I was just pointing out that this was more of a polyfill than a long term solution.
- pestaa 14y agoActually I believe it is position: fixed.
- michalstanko 14y agoFrom the article linked above: "position: sticky is a new way to position elements and is conceptually similar to position: fixed. The difference is that an element with position: sticky behaves like position: relative within its parent, until a given offset threshold is met in the viewport."
- shivalry 14y agov cool -- I've always wanted an easy way to do this!
- Bjoern 14y agoI was looking at the jsfiddle and it doesn't work for me in FF16, is this Chrome only?
- mattwiller 14y agoThat's odd -- I just tried it in FF16 and it seemed to be working fine. It should definitely work cross-browser, but if you find a reason why it's not I'd love to hear it!
- callmevlad 14y agoGreat work! Looks very similar to the more mature jQuery Waypoints library [1]. [1] http://imakewebthings.com/jquery-waypoints/sticky-elements/ http://imakewebthings.com/jquery-waypoints/sticky-elements/
- techunicorn 14y agoSweet!
- nedwin 14y agoNice. We did this with a nice little call to action button that "snaps" to the header as you scroll past: http://blog.tweaky.com/how-to-make-a-sticky-button/ http://blog.tweaky.com/how-to-make-a-sticky-button/
- jvermasheina 14y agoI like the idea. I'd like to do something like that but with responsive design? Any ideas?
- risratorn 14y agoAm I the only one what found the title of this post misleading? It's a plugin to make any dom element stick in the viewport ... the title made me think that it's a plugin that collects user behaviour?
- joshuamerrill 14y agoYes! That's exactly what I thought it was. Do you know of any script that does that?
- peteretep 14y agoI wrote one circa 2003, and there's an article about it here: http://www.drdobbs.com/web-development/mouse-tracking-with-javascript-and-perl/184416000 http://www.drdobbs.com/web-development/mouse-tracking-with-j...
- risratorn 14y agoYea well it can be done with Google analytics but requires some real in-depth knowledge and lots of setting things up. Clicktale (http://www.clicktale.com/ http://www.clicktale.com/) is another one but I don't have any experience with it. Maybe there are other tools that I don't know of though.
- polyfractal 14y agoCrazyEgg (http://crazyegg.com http://crazyegg.com) and Inspectlet (http://inspectlet.com http://inspectlet.com) do similar things. Mouse/click tracking, watching users as they move through your site, etc.
- fox91 14y agoLOL, thought the same
- MichaelApproved 14y ago1) Make the demo link big, first and easy to find. It's the most important part of the page. 2) Failed to work (using first gen iPad).
- mattmanser 14y agoThis is one design pattern that I personally find incredibly irritating. I have no idea why either, perhaps because a page no longer behaves like a page. All of a sudden something just sticks to the top of the browser, I just want to shake it off!
- riffraff 14y agoisn't this the same as the "affix" js in twitter bootstrap or am I missing something?
- matb33 14y agoI wrote something similar, but with the added capability of having elements stack against each other as well: https://github.com/matb33/jquery-vertical-stack https://github.com/matb33/jquery-vertical-stack
- mattwiller 14y agoNice! The stacking capability is definitely something I'd thought about adding in a future version.