1

在我的 JSF 页面上,我根据复选框的值显示了一些内容。重新渲染此内容时,如何附加效果(如淡入和淡出)?有什么活动之类的onRender吗?

这是我到目前为止得到的,但效果没有显示:

<t:selectBooleanCheckbox title="Yes" label="Yes" value="#{myBean.booleanValue}">
   <a4j:support ajaxSingle="true" event="onchange" reRender="panel"/
</t:selectBooleanCheckbox>

<t:div id="panel">
     <rich:effect name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>
     <rich:effect name="showDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:0.1,to:1.0"/>
   <t:panelGrid columns="2" rendered="#{myBean.booleanValue}" id="myPanelGrid">
...
...
...
   </t:panelGrid>
</t:div>
4

1 回答 1

0

您忘记的是事件属性。

<rich:effect event="onmouseout" name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>

如果您愿意,也可以通过 js 调用显示效果。

<rich:effect name="hideDiv" for="myPanelGrid" type="Opacity" params="duration:0.8,from:1.0,to:0.1"/>

<input type="button" onclick="hideDiv" value="Hide" />

更多细节可以在这里找到,Richfaces-demo

于 2010-12-07T14:28:32.933 回答