Drag and drop is a gateway drug with DragDealer

作者: nick 分类: js, widget 发布时间: 2010-06-22 15:29 ė 6没有评论

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:

<div id=”my-slider” class=”dragdealer”>
<div class=”red-bar handle”>drag me</div>
</div>
<script>
new Dragdealer(‘simple-slider’);
</script>

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’;
}
});

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

发表评论

您的电子邮箱地址不会被公开。

Ɣ回顶部