【问题标题】:Javascript/HTML/CSS Wheel of fortune rotate only by difference?Javascript/HTML/CSS 命运之轮仅靠差异旋转?
【发布时间】:2019-03-07 07:12:00
【问题描述】:

我正在构建一个轮盘赌,它应该真实地旋转,并通过拖动轮子并放开它来操作。

我已经得到了 1:1 的旋转,我只需要让它在松开后真实地旋转。

我通过测量两帧之间的距离来计算力。

你可以在这里查看源代码:http://www.techgoldmine.com/spinny_thing

【问题讨论】:

    标签: javascript jquery css rotation dom-manipulation


    【解决方案1】:

    我不清楚您的问题,但您需要清除文档上 mouseup 的时间间隔。

    $('.mouse_trap').mousedown(function(){
            intervalvar = setInterval(monitorClicks, 24);
    
            /*will clear the interval and unbind the function on first mouseup on the document*/
            $(document).one('mouseup', function ()
            {
                clearInterval(intervalvar);
            });
        });
    

    【讨论】:

    • 糟糕,抱歉我之前的回复。非常感谢,您实际上解决了另一个问题。
    猜你喜欢
    • 2016-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多