作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我的 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>
最佳答案
您忘记的是事件属性。
<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
关于javascript - 如何使用富:effect with a4j:support and reRender,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4326060/
我是一名优秀的程序员,十分优秀!