This commit is contained in:
Joseph Cheung 2023-02-27 20:53:25 +08:00
parent 57af29c059
commit b9c17f4673
2 changed files with 14 additions and 605 deletions

File diff suppressed because one or more lines are too long

View file

@ -876,8 +876,8 @@ def search():
document.addEventListener('mousemove', move) document.addEventListener('mousemove', move)
function move(e) { function move(e) {
modal.style.left = e.targetTouches[0].pageX - x + 'px'; modal.style.left = e.pageX - x + 'px';
modal.style.top = e.targetTouches[0].pageY - y + 'px'; modal.style.top = e.pageY - y + 'px';
} }
// (3) 鼠标弹起就让鼠标移动事件移除 // (3) 鼠标弹起就让鼠标移动事件移除
document.addEventListener('mouseup', function () { document.addEventListener('mouseup', function () {
@ -885,8 +885,8 @@ def search():
}) })
}) })
title.addEventListener('touchstart', function (e) { title.addEventListener('touchstart', function (e) {
var x = e.pageX - modal.offsetLeft; var x = e.targetTouches[0].pageX - modal.offsetLeft;
var y = e.pageY - modal.offsetTop; var y = e.targetTouches[0].pageY - modal.offsetTop;
// (2) 鼠标移动的时候把鼠标在页面中的坐标减去 鼠标在盒子内的坐标就是模态框的left和top值 // (2) 鼠标移动的时候把鼠标在页面中的坐标减去 鼠标在盒子内的坐标就是模态框的left和top值
document.addEventListener('touchmove ', move) document.addEventListener('touchmove ', move)
function move(e) { function move(e) {
@ -1158,11 +1158,13 @@ function proxify()
for(let i=prompt.url_proxy.length;i>=0;--i) for(let i=prompt.url_proxy.length;i>=0;--i)
{ {
if(document.querySelector("#fnref\\:"+String(i+1))) if(document.querySelector("#fnref\\:"+String(i+1)))
{
document.querySelector("#fnref\\:"+String(i+1)).removeAttribute('href') document.querySelector("#fnref\\:"+String(i+1)).removeAttribute('href')
document.querySelector("#fnref\\:"+String(i+1)).addEventListener('click', function () { document.querySelector("#fnref\\:"+String(i+1)).addEventListener('click', function () {
modal.style.display = 'block'; modal_open(prompt.url_proxy[i+2]) modal.style.display = 'block'; modal_open(prompt.url_proxy[i+2])
}); });
document.querySelector("#fnref\\:"+String(i+1)).removeAttribute('id') document.querySelector("#fnref\\:"+String(i+1)).removeAttribute('id')
}
} }
}catch(e){} }catch(e){}