gpt4 book ai didi

polymer - 纸卷页眉面板不起作用

转载 作者:行者123 更新时间:2023-12-01 02:03:36 26 4
gpt4 key购买 nike

HTML 文档正文包含两个独立的 paper-scroll-header-panel s 在 neon-animated-page 内.切换后neon-animated-page从第 0 页到第 1 页,paper-scroll-panel在第 1 页上不起作用。

http://jsbin.com/winedi/edit?html,output

最佳答案

原因:paper-scroll-header-panel 首次加载时计算页眉高度。然后它只监听 Iron-resize 事件。但是霓虹动画页面在切换页面时不会触发铁调整大小事件。
来自 https://github.com/PolymerElements/paper-scroll-header-panel/blob/master/paper-scroll-header-panel.html .行号 230

 * By default, the height will be measured when it is ready.  If the height
* changes later the user needs to either set this value to reflect the
* new height or invoke `measureHeaderHeight()`.

解决方案:我已经通过显式调用第二个paper-scroll-header-panel 的measureHeaderHeight() 方法解决了这个问题。检查这个 http://jsbin.com/visazasena/edit?html,output
Polymer({
is: "inbox-view",

next_page: function() {
document.querySelector("#main-page").selected = 1;
}

});

将此更改为
Polymer({
is: "inbox-view",

next_page: function() {
document.querySelector("#main-page").selected = 1;
document.querySelector("#panel").measureHeaderHeight();

}
});

关于polymer - 纸卷页眉面板不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34405453/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com