mirror of
https://gitee.com/energye/energy.git
synced 2024-12-16 02:11:35 +08:00
eff23a18cb
And Windows Drag Region
39 lines
1.7 KiB
Go
39 lines
1.7 KiB
Go
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>browser-linux</title>
|
|
<style>
|
|
|
|
</style>
|
|
<script type="application/javascript">
|
|
function divMnmousedown(e) {
|
|
windowDrag.mousedown(e.clientX, e.clientY);
|
|
document.onmousemove = function (e) {
|
|
e.preventDefault()
|
|
windowDrag.mousemove(e.clientX, e.clientY);
|
|
}
|
|
document.onmouseup = function () {
|
|
windowDrag.mouseup();
|
|
document.onmousemove = null;
|
|
document.onmouseup = null;
|
|
};
|
|
}
|
|
</script>
|
|
</head>
|
|
<body style="overflow: hidden;margin: 0px;padding: 0px; ">
|
|
<div style="width: 600px;-webkit-app-region: drag; border: 1px solid red;">
|
|
<a href="https://www.baidu.com" target="_blank" style="-webkit-app-region: no-drag">百度</a>
|
|
<a href="/" target="_blank" style="-webkit-app-region: no-drag">当前页面</a>
|
|
<a href="https://energy.yanghy.cn" style="-webkit-app-region: no-drag">Energy</a>
|
|
<a href="/" target="_blank" style="-webkit-app-region: no-drag">当前页面-新窗口</a>
|
|
<a href="https://www.baidu.com" style="-webkit-app-region: no-drag" target="_blank">百度新窗口</a>
|
|
<a href="https://www.baidu.com" style="-webkit-app-region: no-drag">百度当前窗口</a>
|
|
<div style="position: absolute;width: 100px;height: 100px;-webkit-app-region: drag; border: 1px solid red;left: 0;top: 0;"></div>
|
|
<div style="position: absolute;width: 200px;height: 100px; border: 1px solid red;left: 100px;top: 100px;"
|
|
onmousedown="divMnmousedown(event)">
|
|
这里是鼠标事件 onmousedown="onmousedown(event)"
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |