Drag and drop is a gateway drug with DragDealer
DragDealer is a fine new JavaScript component that abstracts both touch and point interfaces.
It makes life easy to do sliders and the like:
HTML:
But, it can do so much more. Most of the power comes from tying functions into the drag movements. A good example here is the font size widget that they show:
JAVASCRIPT:
new Dragdealer(‘magnifier’, {
steps: 6,
snap: true,
animationCallback: function(x, y) {
text.style.fontSize = String(12 + x * 24) + ‘px’;
}
});
steps: 6,
snap: true,
animationCallback: function(x, y) {
text.style.fontSize = String(12 + x * 24) + ‘px’;
}
});
Continuing on from here, you can see rich examples such as this component that looks like a rich carousel-esque widget from the front of a news paper:
本文出自 传播、沟通、分享,转载时请注明出处及相应链接。
本文永久链接: https://www.nickdd.cn/?p=794