1
<!-- attaching by event 鼠标移走后,所在的panel变半透明-->
< rich:panel >
< rich:effect event = "onmouseout" type = "Opacity" params = "duration:0.8,from:1.0,to:0.3" />
.... panel content ....
</ rich:panel >
...
<!-- invoking from javascript 点Hide按钮,div隐藏;点Show按钮,div显示-->
< div id = "contentDiv" >
..... div content ......
</ div >
< input type = "button" onclick = "hideDiv({duration:0.7})" value = "Hide" />
< input type = "button" onclick = "showDiv()" value = "Show" />
< rich:effect name = "hideDiv" for = "contentDiv" type = "Fade" />
< rich:effect name = "showDiv" for = "contentDiv" type = "Appear" />
<!-- attaching to window on load and applying on particular page element 页面刚加载时, contentDiv按params表达式显示 -->
< rich:effect for = "window" event = "onload"
type = "Appear" params = "targetId:'contentDiv',duration:0.8,from:0.3,to:1.0" />
我的示例:
div在一开始不显示,当点击show时div显示,当点击Hide时div隐藏。
<rich:effect for="window" event="onload"
type="Fade" params="targetId:'contentDiv',duration:0.0,from:0.0,to:0.0" />
<h:outputLabel οnclick="showDiv()" value="show" />
| #{' '}
<h:outputLabel οnclick="hideDiv({duration:0.7})" value="hide" />
<rich:effect name="hideDiv" for="contentDiv" type="BlindUp" />
<rich:effect name="showDiv" for="contentDiv" type="BlindDown" />
<div id="contentDiv">
。。。
</div>