无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>statistics test</title>
<link type="text/css" rel="stylesheet" href="../css/statistics.css"/>
<script src="/UploadFiles/2021-04-02/jquery.js"><style type="text/css">
.dropdiv{
width: 177px;
height: 16px;
overflow: hidden;
float: left;
font-size: 13px;
font-family: "微软雅黑";
position: relative;
padding: 5px;
}
.drpdown{
width: 214px;
height: 24px;
font-size: 13px;
font-family:"微软雅黑";
position: relative;
border:none;
padding-top:4px;
background:url(../images/dropdown.png) repeat-x;
}
.drpdown:active{
width: 214px;
height: 24px;
font-size: 13px;
font-family:"微软雅黑";
position: relative;
border:none;
padding-top:4px;
background:url(../images/dropdown.png) repeat-x;
}
.droparrow{
width:27px;
height:27px;
background:url(../images/droparrow.png) no-repeat;
float:right;
}
.droparrow:hover{
width:25px;
height:25px;
background:url(../images/droparrow.png) no-repeat;
float:right;
border:#F00 1px solid;
}
.dropmiandiv{
margin-left:40px;
width:214px;
border: 2px solid #aaaaaa;
background:url(../images/dropdown.png) repeat-x;
height: 26px;
}
.chooseItems{
border:#666 2px solid;
}
.chooseItems .chooseItem{
font-size: 13px;
font-family: "微软雅黑";
padding: 5px;
}
.chooseItems .chooseItem:hover{
background:#09F;
}
</style>
</head>
<body>
<div class="dropmiandiv" quest ="select1">
<div id ="select1" displayMember="-1" valueMember ="请选择" class="dropdiv">请选择</div>
<div class="droparrow"></div>
</div>
<div class="chooseItems" answer ="select1" style="display:none; position:absolute;">
<div class="chooseItem" displayMember="0" valueMember ="独立注册译员">独立注册译员</div>
<div class="chooseItem" displayMember="1" valueMember ="供应商译员">供应商译员</div>
<div class="chooseItem" displayMember="2" valueMember ="供应商">供应商</div>
<div class="chooseItem" displayMember="3" valueMember ="代理商">代理商</div>
</div>
<div class="dropmiandiv" quest ="select2" style="position:absolute;top:200px;">
<div id ="select2" displayMember="-1" valueMember ="请选择" class="dropdiv">请选择</div>
<div class="droparrow"></div>
</div>
<div class="chooseItems" answer ="select2" style="display:none; position:absolute;">
<div class="chooseItem" displayMember="0" valueMember ="独立注册译员">独立注册译员</div>
<div class="chooseItem" displayMember="1" valueMember ="供应商译员">供应商译员</div>
<div class="chooseItem" displayMember="2" valueMember ="供应商">供应商</div>
<div class="chooseItem" displayMember="3" valueMember ="代理商">代理商</div>
</div>
</body>
</html>
<script type="text/javascript">
$(".droparrow").click(function(e){
var quest = $(this).parent();
var questwidth = parseInt(quest.width());
var questheight = quest.height();
var left = quest.offset().left;
var top = parseInt(quest.offset().top)+parseInt(questheight)+4;
var attrs = quest.attr("quest");
var selectsd = $('.chooseItems[answer='+attrs+']');
var selectsdHeight = selectsd.height();
if((top+selectsdHeight)>$(window).height()){
top = top - selectsdHeight - questheight-7;
}
if($(selectsd).is(":visible")){
$(selectsd).hide();
}else{
$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show();
}
});
$(".dropdiv").click(function(e){
var quest = $(this).parent();
var questwidth = parseInt(quest.width());
var questheight = quest.height();
var left = quest.offset().left;
var top = parseInt(quest.offset().top)+parseInt(questheight)+4;
var attrs = quest.attr("quest");
var selectsd = $('.chooseItems[answer='+attrs+']');
var selectsdHeight = selectsd.height();
if((top+selectsdHeight)>$(window).height()){
top = top - selectsdHeight - questheight-7;
}
if($(selectsd).is(":visible")){
$(selectsd).hide();
}else{
$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show();
}
});
$(".chooseItem").click(function(e){
var divhtml = $(this);
var displayMember,valueMember;
displayMember = divhtml.attr("displayMember");
valueMember = divhtml.attr("valueMember");
var attrs =$(this).parent().attr("answer");
var parent = $("#"+attrs);
var olddisplayMember,oldvalueMember;
olddisplayMember = parent.attr("displayMember");
oldvalueMember = parent.attr("valueMember");
if(olddisplayMember !=displayMember){
parent.attr("displayMember",displayMember);
parent.attr("valueMember",valueMember);
parent.html(valueMember);
parent.change();
}
$(this).parent().hide();
});
$(".dropdiv").change(function(e){
alert($(this).attr("valueMember"));
});
$(".dropmiandiv").mouseleave(function(e){
var quest = $(this).attr("quest");
$('.chooseItems[answer='+quest+']').hide();
});
$(".chooseItems").mouseenter(function(e){
$(this).show();
});
$(".chooseItems").mouseleave(function(e){
$(this).hide();
});
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>statistics test</title>
<link type="text/css" rel="stylesheet" href="../css/statistics.css"/>
<script src="/UploadFiles/2021-04-02/jquery.js"><style type="text/css">
.dropdiv{
width: 177px;
height: 16px;
overflow: hidden;
float: left;
font-size: 13px;
font-family: "微软雅黑";
position: relative;
padding: 5px;
}
.drpdown{
width: 214px;
height: 24px;
font-size: 13px;
font-family:"微软雅黑";
position: relative;
border:none;
padding-top:4px;
background:url(../images/dropdown.png) repeat-x;
}
.drpdown:active{
width: 214px;
height: 24px;
font-size: 13px;
font-family:"微软雅黑";
position: relative;
border:none;
padding-top:4px;
background:url(../images/dropdown.png) repeat-x;
}
.droparrow{
width:27px;
height:27px;
background:url(../images/droparrow.png) no-repeat;
float:right;
}
.droparrow:hover{
width:25px;
height:25px;
background:url(../images/droparrow.png) no-repeat;
float:right;
border:#F00 1px solid;
}
.dropmiandiv{
margin-left:40px;
width:214px;
border: 2px solid #aaaaaa;
background:url(../images/dropdown.png) repeat-x;
height: 26px;
}
.chooseItems{
border:#666 2px solid;
}
.chooseItems .chooseItem{
font-size: 13px;
font-family: "微软雅黑";
padding: 5px;
}
.chooseItems .chooseItem:hover{
background:#09F;
}
</style>
</head>
<body>
<div class="dropmiandiv" quest ="select1">
<div id ="select1" displayMember="-1" valueMember ="请选择" class="dropdiv">请选择</div>
<div class="droparrow"></div>
</div>
<div class="chooseItems" answer ="select1" style="display:none; position:absolute;">
<div class="chooseItem" displayMember="0" valueMember ="独立注册译员">独立注册译员</div>
<div class="chooseItem" displayMember="1" valueMember ="供应商译员">供应商译员</div>
<div class="chooseItem" displayMember="2" valueMember ="供应商">供应商</div>
<div class="chooseItem" displayMember="3" valueMember ="代理商">代理商</div>
</div>
<div class="dropmiandiv" quest ="select2" style="position:absolute;top:200px;">
<div id ="select2" displayMember="-1" valueMember ="请选择" class="dropdiv">请选择</div>
<div class="droparrow"></div>
</div>
<div class="chooseItems" answer ="select2" style="display:none; position:absolute;">
<div class="chooseItem" displayMember="0" valueMember ="独立注册译员">独立注册译员</div>
<div class="chooseItem" displayMember="1" valueMember ="供应商译员">供应商译员</div>
<div class="chooseItem" displayMember="2" valueMember ="供应商">供应商</div>
<div class="chooseItem" displayMember="3" valueMember ="代理商">代理商</div>
</div>
</body>
</html>
<script type="text/javascript">
$(".droparrow").click(function(e){
var quest = $(this).parent();
var questwidth = parseInt(quest.width());
var questheight = quest.height();
var left = quest.offset().left;
var top = parseInt(quest.offset().top)+parseInt(questheight)+4;
var attrs = quest.attr("quest");
var selectsd = $('.chooseItems[answer='+attrs+']');
var selectsdHeight = selectsd.height();
if((top+selectsdHeight)>$(window).height()){
top = top - selectsdHeight - questheight-7;
}
if($(selectsd).is(":visible")){
$(selectsd).hide();
}else{
$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show();
}
});
$(".dropdiv").click(function(e){
var quest = $(this).parent();
var questwidth = parseInt(quest.width());
var questheight = quest.height();
var left = quest.offset().left;
var top = parseInt(quest.offset().top)+parseInt(questheight)+4;
var attrs = quest.attr("quest");
var selectsd = $('.chooseItems[answer='+attrs+']');
var selectsdHeight = selectsd.height();
if((top+selectsdHeight)>$(window).height()){
top = top - selectsdHeight - questheight-7;
}
if($(selectsd).is(":visible")){
$(selectsd).hide();
}else{
$(selectsd).css({"left":left+"px","top":top+"px","width":questwidth+"px"}).show();
}
});
$(".chooseItem").click(function(e){
var divhtml = $(this);
var displayMember,valueMember;
displayMember = divhtml.attr("displayMember");
valueMember = divhtml.attr("valueMember");
var attrs =$(this).parent().attr("answer");
var parent = $("#"+attrs);
var olddisplayMember,oldvalueMember;
olddisplayMember = parent.attr("displayMember");
oldvalueMember = parent.attr("valueMember");
if(olddisplayMember !=displayMember){
parent.attr("displayMember",displayMember);
parent.attr("valueMember",valueMember);
parent.html(valueMember);
parent.change();
}
$(this).parent().hide();
});
$(".dropdiv").change(function(e){
alert($(this).attr("valueMember"));
});
$(".dropmiandiv").mouseleave(function(e){
var quest = $(this).attr("quest");
$('.chooseItems[answer='+quest+']').hide();
});
$(".chooseItems").mouseenter(function(e){
$(this).show();
});
$(".chooseItems").mouseleave(function(e){
$(this).hide();
});
</script>
标签:
js,下拉选择框
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年11月18日
2024年11月18日
- ABC唱片-鲍比达·新民乐《满江红》[APE+CUE]
- 许嵩.2014-不如吃茶去【海蝶】【WAV+CUE】
- 周笔畅.2024-HAVE.A.GOOD.NIGHT【SN.Music】【FLAC分轨】
- 周笔畅.2024-HAVE.A.NICE.DAY【SN.Music】【FLAC分轨】
- 证声音乐图书馆《真夏派对 x 迪斯可》[FLAC/分轨][380.78MB]
- 证声音乐图书馆《星空下 爵士钢琴》[320K/MP3][65.88MB]
- 证声音乐图书馆《星空下 爵士钢琴》[FLAC/分轨][283.95MB]
- 沙门怀一《竹山听雨HQ》头版限量[低速原抓WAV+CUE]
- 沙门怀一《于喁·壹HQ》头版限量编号[低速原抓WAV+CUE]
- 群星《魅音绝唱》黑胶CD【WAV】
- 腾格尔.2002-四十独白【风潮】【WAV+CUE】
- 陈明真.1992-到哪里找那么好的人【华星】【WAV+CUE】
- 黄凯芹.2012-廿五年3CD【环球】【WAV+CUE】
- 证声音乐图书馆《七夕 爵士情缘》[320K/MP3][64.8MB]
- 证声音乐图书馆《七夕 爵士情缘》[FLAC/分轨][327.79MB]