Tag: touchmove

通过mousemove / touchmove bug进行SVG角度旋转

我想用一个点指针通过mousemove / touchmove旋转svg循环。 我尝试了很多js脚本(例如Touchy Wheel Demo和Rotate Dial Demo ),他们的例子很完美,但是当我尝试我的例子时,我总是看到两个bug: 旋转仅在圆形的下部,顶部 – 它反向旋转。 旋转工作非常缓慢(在演示轮中强烈跟随鼠标/手指)。 我的演示: https ://jsfiddle.net/0L87uabc/8/(请看之前如何在作者的演示页面上工作) 此外,我尝试这个简单的例子-result类似于上面: var dragging = false $(function() { var circles = [‘circle-l1’, ‘circle-l2’, ‘circle-l3’, ‘circle-l4’, ‘circle-l5’, ‘circle-l6’, ‘circle-l7’]; $.each(circles, function(ind, val) { var target = $(‘#’+val) target.mousedown(function() { dragging = true }) $(document).mouseup(function() { dragging = false }) target.mousemove(function(e) { […]

单击并按住以滚动,touchstart,touchmove,touchend

我有一个可滚动的div。 我希望人们能够通过“保持”滚动列表,并选择一个按钮进行点击。 问题是当按住按钮以滚动div时,它会触发点击function。 我想滚动时不要触发。 我需要一些方法来区分保持function的点击。 所以我正在使用: $(‘.panel’).bind(“touchstart mousedown”, function (e) { console.log(e.type); $(this).addClass(‘resize’); }).bind(“touchmove mousemove”, function (e) { $(this).removeClass(‘resize’); }).bind(“touchend mouseup”, function (e) { $(this).removeClass(‘resize’); $(‘.panel’).addClass(‘flip’); }); 我想到了以下解决方案。 当’.panel’被mousedown超过500 ms ,按钮激活,按下: $(this).addClass(‘resize’); 当’.panel’是mouseup ,按钮返回正常状态,然后所有按钮进行输出移动: $(this).removeClass(‘resize’); $(‘.panel’).addClass(‘flip’); 但是,如果用户mousedown ,则mousedown和mouseup操作将被取消。 只是不知道如何将其付诸实践 与此类似: http : //m.microsoft.com/windowsphone/en-us/demo/default.aspx 请建议。