asvd / dragscroll

micro library for drag-n-drop scrolling style
http://asvd.github.io/dragscroll/
MIT License
1.09k stars 168 forks source link

Add indicator during scroll #57

Closed Peadey closed 4 years ago

Peadey commented 4 years ago

Hi Folks,

since I need to be able to click items within the scroll area when this is not in "scroll mode" I added an addidtional class to the dragscroll-element. So I can query this class to prevent clicking these items during scroll. Perhaps anyone would like to use this too:

Snippet:

after Line 61:

el.classList.remove("dragging");

after Line 70:

el.classList.add("dragging");

Handle the click with jQuery:

$(".item").on("mouseup", function() { if(!$(this).parents(".scroll-area").hasClass("dragging")) { // do something } })