下拉框select
来源:互联网 发布:mac有steam吗 编辑:程序博客网 时间:2024/05/22 05:56
<!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>下拉框select demo</title>
</head>
<style type="text/css">
* {
padding:0;
margin:0
}
body {
font-size:12px
}
.select_box {
background: url("images/select_bg.gif") no-repeat scroll left top transparent;
color: #444444;
cursor: pointer;
float: left;
position: relative;
width: 98px;
}
.select_txt {
cursor: pointer;
display: inline-block;
height: 24px;
line-height: 24px;
overflow: hidden;
padding-left: 10px;
width: 88px;
}
.option {
border: 1px solid #EDE7D6;
display: none;
left: -1px;
overflow: hidden;
position: absolute;
top: 24px;
width: 98px;
z-index: 2;
}
.option a {
background: none repeat scroll 0 0 #FFFFFF;
display: block;
height: 26px;
line-height: 26px;
padding: 0 10px;
text-align: left;
width: 100%;
}
</style>
<body>
<div class="select_box"><span class="select_txt">所在地区</span>
<div class="option"><a>生产加工</a><a>经销批发</a><a>招商代理</a><a>商业服务</a><a>其他</a></div>
</div>
</body>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript">
//select下拉框
$(document).ready(function(){
$(".select_box").click(function(event){
event.stopPropagation();
$(this).find(".option").toggle();
$(this).parent().siblings().find(".option").hide();
});
$(document).click(function(event){
var eo=$(event.target);
if($(".select_box").is(":visible") && eo.attr("class")!="option" && !eo.parent(".option").length)
$('.option').hide();
});
/*赋值给文本框*/
$(".option a").click(function(){
var value=$(this).text();
$(this).parent().siblings(".select_txt").text(value);
$("#select_value").val(value)
})
})
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>下拉框select demo</title>
</head>
<style type="text/css">
* {
padding:0;
margin:0
}
body {
font-size:12px
}
.select_box {
background: url("images/select_bg.gif") no-repeat scroll left top transparent;
color: #444444;
cursor: pointer;
float: left;
position: relative;
width: 98px;
}
.select_txt {
cursor: pointer;
display: inline-block;
height: 24px;
line-height: 24px;
overflow: hidden;
padding-left: 10px;
width: 88px;
}
.option {
border: 1px solid #EDE7D6;
display: none;
left: -1px;
overflow: hidden;
position: absolute;
top: 24px;
width: 98px;
z-index: 2;
}
.option a {
background: none repeat scroll 0 0 #FFFFFF;
display: block;
height: 26px;
line-height: 26px;
padding: 0 10px;
text-align: left;
width: 100%;
}
</style>
<body>
<div class="select_box"><span class="select_txt">所在地区</span>
<div class="option"><a>生产加工</a><a>经销批发</a><a>招商代理</a><a>商业服务</a><a>其他</a></div>
</div>
</body>
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript">
//select下拉框
$(document).ready(function(){
$(".select_box").click(function(event){
event.stopPropagation();
$(this).find(".option").toggle();
$(this).parent().siblings().find(".option").hide();
});
$(document).click(function(event){
var eo=$(event.target);
if($(".select_box").is(":visible") && eo.attr("class")!="option" && !eo.parent(".option").length)
$('.option').hide();
});
/*赋值给文本框*/
$(".option a").click(function(){
var value=$(this).text();
$(this).parent().siblings(".select_txt").text(value);
$("#select_value").val(value)
})
})
</script>
</html>
效果如下:
- select下拉框
- select下拉框处理
- select下拉框美化
- 下拉框select
- 自定义select下拉框
- Struts Select下拉框
- 下拉框select使用
- Select Input下拉框
- 【人力资源】--- select下拉框
- 下拉列表框select
- select下拉框
- select下拉框
- select选择下拉框
- Angular4---select下拉框
- select 下拉框和下拉列表美化
- 自定义下拉框控件(<select></select>)
- select下拉框插件jquery.editable-select
- javascript 之 select下拉框
- jpa级联操作详解1-级联保存(CascadeType.PERSIST)
- C语言位运算详解
- Servlet接口五种方法介绍
- 安卓开发20:动画之Animation 详细使用-主要通过java代码实现动画效果
- 小米2 不能连接调试的问题
- 下拉框select
- activemq serviceMix集成学习
- 添加Oracle表空间数据文件语句
- 淘宝网采用什么技术架构来实现网站高负载的
- 线程属性pthread_attr_t简介
- Find Longest Unrepeated Letters in Cyclic Linked-List
- 网络编程:优雅关闭socket/TIME_WAIT/CLOSE_WAIT/SoLinger
- JAVA学习(十六)__Hibernate三种状态的区分,以及save,update,saveOrUpdate,merge等的使用
- Unity游戏换装