Skip to content

Commit 5d41769

Browse files
committed
文章封面加载优化
1 parent 38ab294 commit 5d41769

File tree

5 files changed

+12
-2
lines changed

5 files changed

+12
-2
lines changed

assets/css/app.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/js/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ $(document).ready(function(){
9797
var marginTop = (containerHeight - imgHeight) / 2;
9898
img.css('margin-top', marginTop + 'px');
9999
}
100+
101+
setTimeout(function(){
102+
img.css({
103+
'transition': '.6s',
104+
'opacity': '1'
105+
});
106+
}, 0);
107+
100108
}
101109

102110
postCover($('#postCover'), $('.g-banner'));

dev/sass/app.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ a {
482482
height: 100%;
483483
z-index: -2; }
484484
.post-header .post-cover img {
485+
opacity: 0;
485486
width: 100%; }
486487

487488
.bgcolor-default {

dev/sass/common.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384
height: 100%;
385385
z-index: -2;
386386
img {
387+
opacity: 0;
387388
width: 100%;
388389
}
389390
}

0 commit comments

Comments
 (0)