locked
Draggable touchscreen Div working well in all browsers apart from Chrome RRS feed

  • Question

  • User-2054142495 posted

    Hi,

    The code displayed below is working well with my draggable div. I need this to work well on mouse click and touch screen.

    However this works well on all browsers except Chrome (which is my main browser) here on the touch screen the movement is jerky and stutters.

    Has anybody come across the same or a similar issue which has been corrected?

    $(function () {
        $('#mySummary').on('mousedown', function () {
            $(this).addClass('draggable').parents().on('mousemove', function (e) {
                $('.draggable').offset({
                    top: e.pageY - $('.draggable').outerHeight() / 2,
                    left: e.pageX - $('.draggable').outerWidth() / 2
                }).on('mouseup', function () {
                    $(this).removeClass('draggable');
                });
            });
            e.preventDefault();
        }).on('mouseup', function () {
            $('.draggable').removeClass('draggable');
        });
    });

    Monday, May 16, 2016 3:23 PM

Answers