Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed May 7, 2024
1 parent 886bb1f commit 47fe80d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion p/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#tools div{padding-bottom:5px}
#imgs{margin-top:70px;padding:5px 0 0 5px}
img{margin-top:15px;background-color:#efefef;}
img:first-child{margin-top:0}
img:first-child, img.hidden{margin-top:0}
.mobile #tools{top:auto;bottom:0}
.mobile #imgs{margin-top:0;padding-bottom:72px}
</style>
Expand Down
3 changes: 2 additions & 1 deletion p/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function clearPid () {

function showImg (img) {
img.title = `${img.id} ${img.naturalWidth}✖️${img.naturalHeight}`;

img.classList.remove("hidden");
if (400 / img.naturalHeight * img.naturalWidth > windowWidth) {
// 宽度超过页面时,缩小显示
img.style.width = windowWidth + "px";
Expand Down Expand Up @@ -166,6 +166,7 @@ function createImage (pid, n) {
} else {
img.style.width = "0px";
img.style.height = "0px";
img.classList.add("hidden");
}
img.style.cursor = 'pointer';
img.style.display = 'block';
Expand Down

0 comments on commit 47fe80d

Please sign in to comment.