可否允许编辑/复制?

随便聊聊 · 90 次浏览
sharklaka 创建于 2024-10-14 16:10

因为我是需要用在自己私人动作的一个流程中去

谢谢~


sharklaka 2024-10-14 16:16 :

另外,直接运行动作好像不会成功,必须点击多次屏幕元素,并反复运行动作才可能成功

侧耳倾听& 回复 sharklaka 17天3小时前 :

//.js 
function slide (id) {
    var slider    = document.getElementById(id),
        container = slider.parentNode;
 
    var rect = slider.getBoundingClientRect(),
        x0          = rect.x || rect.left,
        y0          = rect.y || rect.top,
        w           = container.getBoundingClientRect().width,
        x1          = x0 + w,
        y1          = y0;
 
    var mousedown = document.createEvent("MouseEvents");
    mousedown.initMouseEvent("mousedown", true, true, window, 0,
        x0, y0, x0, y0, false, false, false, false, 0, null);
    slider.dispatchEvent(mousedown);
 
    var mousemove = document.createEvent("MouseEvents");
    mousemove.initMouseEvent("mousemove", true, true, window, 0,
        x1, y1, x1, y1, false, false, false, false, 0, null);
    slider.dispatchEvent(mousemove);
 
    var mouseup = document.createEvent("MouseEvents");
    mouseup.initMouseEvent("mouseup", true, true, window, 0,
        x1, y1, x1, y1, false, false, false, false, 0, null);
    slider.dispatchEvent(mouseup);
}
slide('nc_1_n1z');  //  nc_1_n1z  蓝奏云 选择器 

这个

sharklaka 回复 侧耳倾听& 15天10小时前 :

谢谢~!十分感谢

回复内容
暂无回复
回复主贴