gpt4 book ai didi

jquery - mousedown 后移动鼠标时如何防止文本移动?

转载 作者:行者123 更新时间:2023-11-28 05:45:26 28 4
gpt4 key购买 nike

我正在尝试编写一个可移动的对话框,但出现问题。有时当我想通过移动对话框上方的某个位置来移动对话框时,而不是对话框本身,标题文本正在移动,如下所示:

enter image description here

标题文本的

CSS:

.arg-dialog-title{
height: 20px;
font-size: x-large;
padding: 10px 30px 15px 30px;
position: fixed;
background-color: transparent;
box-sizing: initial;
font-weight: bold;
outline: none;
line-height: 1;
border:0;
user-drag: none;
user-select: none;
-moz-user-select: none;
-webkit-user-drag: none;
-webkit-user-select: none;
-ms-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
text-decoration: none;
}

您可以在这个fiddle 中找到所有代码和样式。 .

如何防止此操作发生?

最佳答案

尝试将以下样式应用于您的标题:

user-drag: none; 
user-select: none;

另外,让它监听mousemove事件,调整对话的位置。

关于jquery - mousedown 后移动鼠标时如何防止文本移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37636379/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com