【问题标题】:Effect that works only when the panel is invisible仅在面板不可见时有效
【发布时间】:2011-10-31 03:02:37
【问题描述】:

前几天我发了一个问题:

How to show up an outputPanel with slide effect when there is focus on specific input box?

我得到了上述问题的解决方案,但另一个问题出现在我面前。每次焦点从某个其他元素返回到inputTextArea 时,效果会再次显示在已经可见的outputPanel 上,看起来不太好。

因此,我只想在隐藏outputPanel 时显示效果,而不是每次焦点返回inputTextArea 时显示效果。有什么办法,我可以设置这个条件来显示效果吗?


我正在使用:-

Primefaces 3.0 M3 快照
带有 Facelets 的 JSF 2.0

【问题讨论】:

    标签: jquery jquery-ui jsf jsf-2 primefaces


    【解决方案1】:

    我不知道 Primefaces,但在 jQuery 中你可以做到

    if (!$("element").is(":visible")) 
    {
    //do something if element is not visibile
    }
    

    if ($("element").not(":visible")) 
    {
    //do something if element is not visibile
    }
    

    【讨论】:

      猜你喜欢
      • 2011-02-02
      • 1970-01-01
      • 2013-04-19
      • 2013-02-19
      • 1970-01-01
      • 2014-05-17
      • 1970-01-01
      • 1970-01-01
      • 2020-04-19
      相关资源
      最近更新 更多