2

I have been looking for a long while for a jQuery plugin to add multiple sticky div boxes in the same page.

I found this (and some other plugins but I cant post more than two links)

All of them use the absolute position to make the element sticky and they animate it on window scroll, and they both dont really work very well (for example when a hidden element is toggled in the page) the position just acts funny.

I have seen a wonderful example of what I want on 9gag , the like/dislike buttons next to each post looks so fine, and I think its made with mootools.

Have any of you made such a thing in mootools or jQuery or aware of such plugins?

4

2 に答える 2

3

Welcome to SO!

I was also searching for some 9gag sticky boxes and found this: jQuery Stickem

And here the Demo: Demo of jQuery Stickem
Hope you've searched something like this.

于 2012-10-05T06:36:41.263 に答える
1

If you are using Mootools (as I am) you might want to try my solution http://jsfiddle.net/nK8LR/6/ which allows you to create as many "stickers" as you want, and define for each of them the range within which they should scroll as well as the way in which they are sticked.

You can use it with

  new Sticker({
    elevator: $('item you want to stick'),
    top: {relativeTo:$('item which marks the top range'),edge:'top',offsetY:5},
    bottom: {relativeTo:$('item which marks the bottom'),edge:'bottom',offsetY:-5},
    windowTrigger:$(document),
    windowScroller:$(document.body),
    stickTo: 'top'
  });
于 2014-02-25T14:12:42.430 に答える