【问题标题】:Problem loading two modal panel加载两个模态面板时出现问题
【发布时间】:2011-06-25 11:27:08
【问题描述】:

我有两个模态面板,即 panel1 和 panel2。

两个面板在页面上同时加载,

要求是在 panel2 上加载 panel1。 但是,当页面加载时,它总是会导致 panel2 超过 panel1,而与页面上模型面板位置的代码无关。

我使用的是richfaces-3.3.2-SR1版本

代码在这里:

<rich:modalPanel id="panel1" resizeable="false" showWhenRendered="true">
  My data goes here
</rich:modalPanel>
<rich:modalPanel id="panel2" resizeable="false" showWhenRendered="true">
   <center>
       <h:graphicImage url="image.gif" />
   </center>
</rich:modalPanel>

注意:panel1 包含图片

谢谢 尼克斯

【问题讨论】:

    标签: java html css jsf richfaces


    【解决方案1】:

    尝试设置z-index属性

    z-index 属性指定 元素的堆栈顺序。

    堆栈顺序更大的元素是 总是在带有 a 的元素前面 较低的堆栈顺序。

    注意:z-index 仅适用于定位 元素(位置:绝对, 位置:相对,或位置:固定)。

    试试

    <rich:modalPanel id="panel1" resizeable="false" showWhenRendered="true" zindex="2000">
      My data goes here
    </rich:modalPanel>
    
    <rich:modalPanel id="panel2" resizeable="false" showWhenRendered="true" zindex="1000">
       <center>
           <h:graphicImage url="image.gif" />
       </center>
    </rich:modalPanel>
    

    【讨论】:

    • org.life.java - 谢谢,它有效 :) 没想到用这个简单的 css 来解决它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-14
    • 1970-01-01
    • 1970-01-01
    • 2012-09-02
    相关资源
    最近更新 更多