点击显示和隐藏的菜单
默认是显示一部分,大部分内容是隐藏的,点击后可以展开,注意本例非jquery代码.
XML/HTML Code复制内容到剪贴板
- <div id="main_demo">
- <div style="height:120px;"></div>
- <DIV class="sideMenu haveBanner">
- <BR>
- <SCRIPT language=javascript type=text/javascript>
- var zConfig={
- showConfig:{
- width: {to: 532},
- opacity: {to: 1 }
- },
- hiddenConfig:{
- width: {to: 0},
- opacity: {to: 0 }
- },
- showTime:1,
- hiddenTime:1,
- sFireEvent:"click",
- oAppliedFunction:YAHOO.util.Easing.easeOutStrong
- }
- var showAllCategory=new floatDiv();
- YUE.on(window,"load",function(){
- if(get('MiniMPTitem')){
- var fixHeight = get('MiniMPTitem').offsetHeight;
- if(fixHeight<320){fixHeight=320;}
- get('MinimoreProductTeam').style.height=fixHeight+"px";
- get('moreProductTeam').style.height=fixHeight+"px";
- get('MinimoreProductMaskIframe').style.height=fixHeight+"px";
- get('moreProductTeam').style.display="none";
- var xy = [-128,-135];
- if(!AE.browse.isIE){xy = [-128,-108]}
- var targetXY = YUD.getXY('moreProductTeamBtn');
- var midW = YUD.getViewportWidth()/2;
- var isLeft = targetXY[0] < midW;
- var standX ;
- if(isLeft){
- standX = YUD.getX(YUD.getElementsByClassName('customGroup','div',get('mainContent'))[0]);
- xy[0] = standX - targetXY[0];
- }else{
- standX = YUD.getX(get('mainContent')) + get('mainContent').offsetWidth;
- xy[0] = standX - targetXY[0] - 30;
- }
- showAllCategory.init('moreProductTeamBtn','moreProductTeam',xy,zConfig);
- }
- }
- );
- </SCRIPT>
- <DIV class=customGroup>
- <H3><A href="http://www.freejs.net">www.freejs.net</A></H3>
- <UL>
- <li><a href="daohangcaidan.html" title="各种下拉菜单,导航,多级菜单,右侧展开,左侧展开">导航菜单</a></li>
- <li><a href="tabbiaoqian.html" title="tab标签,选项卡">TAB标签</a></li>
- <li><a href="jiaodiantu.html" title="焦点图,相册">焦点图</a></li>
- <li><a href="jquerytupiantexiao.html" title="Jquery图片特效">Jquery图片特效</a></li>
- <li><a href="fenye.html" title="翻页,分页">分页</a></li>
- <li><a href="biaodan.html" title="表单">表单</a></li>
- </UL>
- <DIV class=customGroupfooter><A class=more id=moreProductTeamBtn
- href="javascript:void(0)">显示更多</A> </DIV>
- </DIV>
- <DIV class=customGroupMore id=MinimoreProductTeam>
- <DIV class=MiniMPTcontainer id=moreProductTeam><IFRAME
- class=MinimoreProductMaskIframe id=MinimoreProductMaskIframe
- style="HEIGHT: 200px" src="about:blank" frameBorder=0></IFRAME><SPAN
- class=MiniMPTclosebtn><A onclick=showAllCategory.hiddenContentForce()
- href="javascript:void(0);"><IMG height=17
- src="freejs/close_more_product_team.gif"
- width=42 border=0></A></SPAN>
- <DIV class=MiniMPTitem id=MiniMPTitem><BR>
- <UL>
- <LI class=column><A
- href="">1</A> </LI>
- <LI class=column><A
- href="">2</A> </LI>
- <LI class=column><A
- href="">3</A> </LI>
- <LI class=column><A
- href="">4</A> </LI>
- <LI class=column><A
- href="">5</A> </LI>
- </UL></DIV></DIV></DIV>
- </DIV>
原文地址:http://www.freejs.net/article_daohangcaidan_3.html