【问题标题】:Display/Hide <p:notificationBar > with the same shortcut <p:hotkey>显示/隐藏 <p:notificationBar > 使用相同的快捷键 <p:hotkey>
【发布时间】:2013-10-04 14:06:39
【问题描述】:

我想隐藏/显示快捷方式&lt;p:hotkey&gt;,我成功在jQuery代码和&lt;p:hotkey&gt;中隐藏了,如何使用相同的键显示?

  <script>
          jQuery(document).ready(function($) {
               $(window).click(function () {
                                         PF('bar').hide();
                                           });
                $(window).blur(function () {
                 PF('bar').hide();
                                           });
                                              });
     </script>

xhtml:

<p:notificationBar autoDisplay="true"  position="top" effect="slide" widgetVar="bar"   style="z-index: 1500;opacity: .98">  
                    <center>
                        <h:outputText value="Select Bank and press Ctrl , + to add agency" style="color:red;font-size:14px;" /><br/><br/>
                        <h:outputText value="Click anywhere or press SPACE to hide this bar" style="color:red;font-size:14px;" />
                    </center> 
                </p:notificationBar>
                <p:hotkey bind="space"  onsuccess="PF('bar').hide()"/>

【问题讨论】:

    标签: javascript jquery jsf jsf-2 primefaces


    【解决方案1】:

    尝试使用

    bar.toggel();
    

    应该可以的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-14
      • 2018-01-09
      • 1970-01-01
      • 1970-01-01
      • 2011-08-24
      相关资源
      最近更新 更多