See jsfiddle below:
jsfiddle
When viewing this on a desktop scrolling, the desktop works as I expect. You can use the scroll bars to scroll through the list, and you can click and drag the fields without scrolling through the list.
My problems arise when I try to scroll this list on the iPad. Every time you touch a window in a list, it is already set to drag and drop, so you cannot scroll through the list and just drag one of them.
Does anyone have any suggestions on how I can make this work? Maybe an alternative solution?
Thanks in advance.
HTML:
<div id="scroller"> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> <div class="color" style="background-color: rgb(107, 163, 93);" data-r="107" data-g="163" data-b="93"></div> </div>
CSS
#scroller { width: 317px; height: 325px; overflow-y: scroll; -webkit-overflow-scrolling: touch; } .color { margin:5px; width: 100px; height: 100px; }
JS:
$(".color").draggable({ scroll: false, helper: "clone", });