【问题标题】:Primefaces sticky tag not definedPrimefaces粘性标签未定义
【发布时间】:2013-11-27 14:35:27
【问题描述】:

我使用的是 Primefaces 3.5,我需要使用 sticky tag。 我从橱窗里得到了代码。 所以这是我的代码:

<p:toolbar id="myToolbar">  
    <p:toolbarGroup align="left">  
        <p:commandButton type="button" value="Some Button" />  
    </p:toolbarGroup>
</p:toolbar>
<p:sticky target="myToolbar" />

我得到错误:

/index.xhtml @26,36 标签库支持命名空间: http://primefaces.org/ui,但没有为名称定义标签:sticky

如果我删除粘性部分,一切正常。这个错误可能是什么?

【问题讨论】:

标签: jsf primefaces definition


【解决方案1】:

恐怕 3.5 不支持它。尝试使用 Primefaces 4.0 - User Guides。 使用 css

.myComponent(
    position: fixed;
)

和一些 jQuery 来模拟类似的行为。这是我不久前编写的一些 JS 代码 sn-p。

$(document).on("scroll", function(){
   if($(document).scrollTop() >= 180){
       $('.header').css({'position': 'fixed'});
       $('#mainBody').css('margin-top', '182px');
   } else {
       $('.header').css({'position': 'relative'});
       $('#mainBody').css('margin-top', '110px');
   }
}    

【讨论】:

    猜你喜欢
    • 2012-07-19
    • 1970-01-01
    • 2011-11-15
    • 1970-01-01
    • 2017-01-15
    • 1970-01-01
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多