mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
2d1529918f
commit
f350a105f2
2 changed files with 10 additions and 12 deletions
|
@ -911,13 +911,12 @@ def search():
|
|||
})
|
||||
})
|
||||
modal.addEventListener('touchstart', function (e) {
|
||||
var x = e.targetTouches[0].pageX - modal.offsetLeft;
|
||||
var y = e.targetTouches[0].pageY - modal.offsetTop;
|
||||
// (2) 鼠标移动的时候,把鼠标在页面中的坐标,减去 鼠标在盒子内的坐标就是模态框的left和top值
|
||||
var x = e.touches[0].pageX - modal.offsetLeft;
|
||||
var y = e.touches[0].pageY - modal.offsetTop;
|
||||
document.addEventListener('touchmove', move)
|
||||
function move(e) {
|
||||
modal.style.left = e.targetTouches[0].pageX - x + 'px';
|
||||
modal.style.top = e.targetTouches[0].pageY - y + 'px';
|
||||
modal.style.left = e.touches[0].pageX - x + 'px';
|
||||
modal.style.top = e.touches[0].pageY - y + 'px';
|
||||
}
|
||||
// (3) 鼠标弹起,就让鼠标移动事件移除
|
||||
document.addEventListener('touchend', function () {
|
||||
|
|
|
@ -911,13 +911,12 @@ def search():
|
|||
})
|
||||
})
|
||||
modal.addEventListener('touchstart', function (e) {
|
||||
var x = e.targetTouches[0].pageX - modal.offsetLeft;
|
||||
var y = e.targetTouches[0].pageY - modal.offsetTop;
|
||||
// (2) 鼠标移动的时候,把鼠标在页面中的坐标,减去 鼠标在盒子内的坐标就是模态框的left和top值
|
||||
var x = e.touches[0].pageX - modal.offsetLeft;
|
||||
var y = e.touches[0].pageY - modal.offsetTop;
|
||||
document.addEventListener('touchmove', move)
|
||||
function move(e) {
|
||||
modal.style.left = e.targetTouches[0].pageX - x + 'px';
|
||||
modal.style.top = e.targetTouches[0].pageY - y + 'px';
|
||||
modal.style.left = e.touches[0].pageX - x + 'px';
|
||||
modal.style.top = e.touches[0].pageY - y + 'px';
|
||||
}
|
||||
// (3) 鼠标弹起,就让鼠标移动事件移除
|
||||
document.addEventListener('touchend', function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue