<div class="codetitle"> <span><a style="CURSOR: pointer" data="39406" class="copybut" id="copybut39406" onclick="doCopy('code39406')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code39406"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><title>statistics test</title> <br><link type="text/css" rel="stylesheet" href="../css/statistics.css"> <br><script src="../js/jquery.js"></script> <br><style type="text/css"> <BR>.dropdiv{ <BR>width: 177px; <BR>height: 16px; <BR>overflow: hidden; <BR>float: left; <BR>font-size: 13px; <BR>font-family: "微软雅黑"; <BR>position: relative; <BR>padding: 5px; <BR>} <BR>.drpdown{ <BR>width: 214px; <BR>height: 24px; <BR>font-size: 13px; <BR>font-family:"微软雅黑"; <BR>position: relative; <BR>border:none; <BR>padding-top:4px; <BR>background:url(../images/dropdown.png) repeat-x; <BR>} <BR>.drpdown:active{ <BR>width: 214px; <BR>height: 24px; <BR>font-size: 13px; <BR>font-family:"微软雅黑"; <BR>position: relative; <BR>border:none; <BR>padding-top:4px; <BR>background:url(../images/dropdown.png) repeat-x; <BR>} <BR>.droparrow{ <BR>width:27px; <BR>height:27px; <BR>background:url(../images/droparrow.png) no-repeat; <BR>float:right; <BR>} <BR>.droparrow:hover{ <BR>width:25px; <BR>height:25px; <BR>background:url(../images/droparrow.png) no-repeat; <BR>float:right; <BR>border:#F00 1px solid; <BR>} <BR>.dropmiandiv{ <BR>margin-left:40px; <BR>width:214px; <BR>border: 2px solid #aaaaaa; <BR>background:url(../images/dropdown.png) repeat-x; <BR>height: 26px; <BR>} <BR>.chooseItems{ <BR>border:#666 2px solid; <BR>} <BR>.chooseItems .chooseItem{ <BR>font-size: 13px; <BR>font-family: "微软雅黑"; <BR>padding: 5px; <BR>} <BR>.chooseItems .chooseItem:hover{ <BR>background:#09F; <BR>} <BR></style> <br> <br><br> <br><br><div class="dropmiandiv" quest="select1"> <br><div id="select1" displaymember="-1" valuemember="请选择" class="dropdiv">请选择</div> <br><div class="droparrow"></div> <br> </div> <br><div class="chooseItems" answer="select1" style="display:none; position:absolute;"> <br><div class="chooseItem" displaymember="0" valuemember="独立注册译员">独立注册译员</div> <br><div class="chooseItem" displaymember="1" valuemember="供应商译员">供应商译员</div> <br><div class="chooseItem" displaymember="2" valuemember="供应商">供应商</div> <br><div class="chooseItem" displaymember="3" valuemember="代理商">代理商</div> <br> </div> <br><br><div class="dropmiandiv" quest="select2" style="position:absolute;top:200px;"> <br><div id="select2" displaymember="-1" valuemember="请选择" class="dropdiv">请选择</div> <br><div class="droparrow"></div> <br> </div> <br><div class="chooseItems" answer="select2" style="display:none; position:absolute;"> <br><div class="chooseItem" displaymember="0" valuemember="独立注册译员">独立注册译员</div> <br><div class="chooseItem" displaymember="1" valuemember="供应商译员">供应商译员</div> <br><div class="chooseItem" displaymember="2" valuemember="供应商">供应商</div> <br><div class="chooseItem" displaymember="3" valuemember="代理商">代理商</div> <br> </div> <br><br> <br><br> <br><script type="text/javascript"> <BR>$(".droparrow").click(function(e){ <BR>var quest = $(this).parent(); <BR>var questwidth = parseInt(quest.width()); <BR>var questheight = quest.height(); <BR>var left = quest.offset().left; <BR>var top = parseInt(quest.offset().top)+parseInt(questheight)+4; <BR>var attrs = quest.attr("quest"); <BR>var selectsd = $('.chooseItems[answer='+attrs+']'); <BR>var selectsdHeight = selectsd.height(); <BR>if((top+selectsdHeight)>$(window).height()){ <BR>top = top - selectsdHeight - questheight-7; <BR>} <BR>if($(selectsd).is(":visible")){ <BR>$(selectsd).hide(); <BR>}else{ <BR>$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show(); <BR>} <BR>}); <BR>$(".dropdiv").click(function(e){ <BR>var quest = $(this).parent(); <BR>var questwidth = parseInt(quest.width()); <BR>var questheight = quest.height(); <BR>var left = quest.offset().left; <BR>var top = parseInt(quest.offset().top)+parseInt(questheight)+4; <BR>var attrs = quest.attr("quest"); <BR>var selectsd = $('.chooseItems[answer='+attrs+']'); <BR>var selectsdHeight = selectsd.height(); <BR>if((top+selectsdHeight)>$(window).height()){ <BR>top = top - selectsdHeight - questheight-7; <BR>} <BR>if($(selectsd).is(":visible")){ <BR>$(selectsd).hide(); <BR>}else{ <BR>$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show(); <BR>} <BR>}); <BR>$(".chooseItem").click(function(e){ <BR>var divhtml = $(this); <BR>var displayMember,valueMember; <BR>displayMember = divhtml.attr("displayMember"); <BR>valueMember = divhtml.attr("valueMember"); <BR>var attrs =$(this).parent().attr("answer"); <BR>var parent = $("#"+attrs); <BR>var olddisplayMember,oldvalueMember; <BR>olddisplayMember = parent.attr("displayMember"); <BR>oldvalueMember = parent.attr("valueMember"); <BR>if(olddisplayMember !=displayMember){ <BR>parent.attr("displayMember",displayMember); <BR>parent.attr("valueMember",valueMember); <BR>parent.html(valueMember); <BR>parent.change(); <BR>} <br><br>$(this).parent().hide(); <BR>}); <BR>$(".dropdiv").change(function(e){ <BR>alert($(this).attr("valueMember")); <BR>}); <BR>$(".dropmiandiv").mouseleave(function(e){ <BR>var quest = $(this).attr("quest"); <BR>$('.chooseItems[answer='+quest+']').hide(); <BR>}); <BR>$(".chooseItems").mouseenter(function(e){ <BR>$(this).show(); <BR>}); <BR>$(".chooseItems").mouseleave(function(e){ <BR>$(this).hide(); <BR>}); <BR></script> <br> </div>