such a list, because there are too many fields to display, I encapsulate the left and right drag and scroll method, because the default event is blocked when mousedown. Default events such as the focus,blur of the form in the list do not work. It"s normal to get rid of the return false in mousedown. But when dragging, Firefox and ie will choose Chinese characters. Change how to solve the problem of dragging and scrolling without selecting the text, and the default event of the form is normal.
drag and scroll method:
var el = this.$ (selector)
var doc = this.$ (document)
el.on ("mousedown", function (ev) {
var preX = ev.clientX
var Left = el.scrollLeft()
doc.on("mousemove.drag", function (ev) {
var disX = preX - ev.clientX
Left += disX
el.scrollLeft(Left)
preX = ev.clientX
return false
})
return false
})
doc.on ("mouseup", function (ev) {
doc.off("mousemove.drag")
})