Skip to content Skip to sidebar Skip to footer

Disabling Drag Scroll For Text Inputs With Jquery

I need to disable the drag scroll functionality when clicking on text inputs. The page is in the format of a table of a div with inputs inside, and you can drag the page horizonta

Solution 1:

You can use event.target to obtain the element that was the event's original target:

$('.dataContent').mousedown(function(event) {
    if ($(event.target).is("input:text")) {
        return;  // Target element is a text input, do not initiate drag.
    }

    // ...
});

Post a Comment for "Disabling Drag Scroll For Text Inputs With Jquery"