mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
c
This commit is contained in:
parent
6ea14be270
commit
39147ca396
2 changed files with 33 additions and 20 deletions
File diff suppressed because one or more lines are too long
|
@ -876,8 +876,8 @@ def search():
|
||||||
document.addEventListener('mousemove', move)
|
document.addEventListener('mousemove', move)
|
||||||
|
|
||||||
function move(e) {
|
function move(e) {
|
||||||
modal.style.left = e.pageX - x + 'px';
|
modal.style.left = e.targetTouches[0].pageX - x + 'px';
|
||||||
modal.style.top = e.pageY - y + 'px';
|
modal.style.top = e.targetTouches[0].pageY - y + 'px';
|
||||||
}
|
}
|
||||||
// (3) 鼠标弹起,就让鼠标移动事件移除
|
// (3) 鼠标弹起,就让鼠标移动事件移除
|
||||||
document.addEventListener('mouseup', function () {
|
document.addEventListener('mouseup', function () {
|
||||||
|
@ -885,13 +885,13 @@ def search():
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
title.addEventListener('touchstart', function (e) {
|
title.addEventListener('touchstart', function (e) {
|
||||||
var x = e.touches[0].pageX - modal.offsetLeft;
|
var x = e.pageX - modal.offsetLeft;
|
||||||
var y = e.touches[0].pageY - modal.offsetTop;
|
var y = e.pageY - modal.offsetTop;
|
||||||
// (2) 鼠标移动的时候,把鼠标在页面中的坐标,减去 鼠标在盒子内的坐标就是模态框的left和top值
|
// (2) 鼠标移动的时候,把鼠标在页面中的坐标,减去 鼠标在盒子内的坐标就是模态框的left和top值
|
||||||
document.addEventListener('touchmove ', move)
|
document.addEventListener('touchmove ', move)
|
||||||
function move(e) {
|
function move(e) {
|
||||||
modal.style.left = e.touches[0].pageX - x + 'px';
|
modal.style.left = e.targetTouches[0].pageX - x + 'px';
|
||||||
modal.style.top = e.touches[0].pageY - y + 'px';
|
modal.style.top = e.targetTouches[0].pageY - y + 'px';
|
||||||
}
|
}
|
||||||
// (3) 鼠标弹起,就让鼠标移动事件移除
|
// (3) 鼠标弹起,就让鼠标移动事件移除
|
||||||
document.addEventListener('touchend', function () {
|
document.addEventListener('touchend', function () {
|
||||||
|
@ -910,7 +910,7 @@ def search():
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
display: none;
|
display: none;
|
||||||
width: 648px;
|
width: 45%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 32%;
|
left: 32%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@ -919,6 +919,14 @@ def search():
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 50em) {
|
||||||
|
.modal {
|
||||||
|
width: 85%;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.modal-title {
|
.modal-title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 10px 0px 0px 0px;
|
margin: 10px 0px 0px 0px;
|
||||||
|
|
Loading…
Add table
Reference in a new issue