使用 vscode 启动服务共享本地图片时快速查看图片脚本

document.querySelectorAll("a").forEach(e=>{
e.onclick=(()=>false)
})
let img = document.createElement('img')
let input = document.querySelector('#input')
img.src=''
img.title=name
img.style="position:fixed;top:50px;right:50px;max-width:35%;max-height:90%display:block;"
img.id='img'
document.querySelector('.directory').insertBefore(img,input);
document.body.style='padding:80px 30% 80px 100px'
document.querySelectorAll(".name").forEach(e=>{
e.onclick=()=>{
let name = e.innerText
img.src="http://localhost:5500/"+name
}
})

效果示意,有了这个脚本就可以非常方便的快捷

posted @   lambertlt  阅读(63)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
历史上的今天:
2022-09-16 Windows 下打包python 程序
点击右上角即可分享
微信分享提示