Closed reuixiy closed 6 years ago
@reuixiy 手机测试未发现,明天试试电脑
好的,我收回上句话,明天开电脑看看吧 @dixyes 日常召唤
The element article.post.post-type-normal
has a css rule transform: translateY(0px)
, it'll create a stacking context, cause the inner DPlayer element use this element for positioning instead of browser window, even if its position
is fixed
. It's a css bug, we have no idea. The only solution is to change your blog's css code.
Reference:
If the property has a value different than none, a stacking context will be created. In that case the object will act as a containing block for position: fixed elements that it contains.
https://segmentfault.com/a/1190000002783265#articleHeader6 (A chinese article about stacking context)
https://www.w3.org/TR/css-transforms-1/#transform-rendering (W3C)
For elements whose layout is governed by the CSS box model, any value other than none for the transform results in the creation of both a stacking context and a containing block. The object acts as a containing block for fixed positioned descendants.
@Myer921 谢谢:innocent:
@RexSkz Thanks a lot, I'll try it.:thumbsup:
Okay, I think I've got it! To solve this problem, I've found two solutions:
~/blog/themes/next/source/css/_custom/custom.styl
:.post.post-type-normal {
transform: inherit !important;
}
true
to false
in ~/blog/themes/next/_config.yml
:# Motion
use_motion: false
However, none of them is perfect. Could you give me a better solution? Or I'd better set up a new issue in hexo-theme-next.
Thanks again. @RexSkz
There're four points:
use_motion
means making elements move to exact places when page is loaded, which is a feature in NexT theme.transform
to accelerate the animation, which is the method that most people will use. Without transform
(for instance, use relative
and top
), it may cause some performance issue.transform
is surely conflict with inner element's full-page style.So they might not make any changes even if you make an issue. The best way is changing the code yourself. I prefer your second idea, because NexT theme has too many element-moves when page is loaded, it's worth to reduce some of them, keeping fade-in effect is enough.
Okay! Thank you so much! @RexSkz
描述
点击图中的按钮,然后…… 纯小白求解决方法……蟹蟹大佬们:grin:
实例
点击这里啦
主题
NexT
插件版本