ud({
onReady() {
let el = document.getElementsByClassName('udesk-client-btn')[0]
if (el) {
el.onmousedown = function (ev) {
window.ud('noDrag')
const disX = ev.clientX - el.offsetLeft
const disY = ev.clientY - el.offsetTop
document.onmousemove = function (ev) {
window.ud('isDrag')
const l = ev.clientX - disX
const t = ev.clientY - disY
el.style.left = l + 'px'
el.style.top = t + 'px'
}
document.onmouseup = function () {
document.onmousemove = null
document.onmouseup = null
}
}
}
}
})
Udesk拖动客服按钮
于 2022-10-21 15:40:52 首次发布