jq 下拉框
<div class="alls">
<div class="item">
<div class="all">
<span class="alla">选择</span>
<span>
<div class="coinbig-c2c-sanj"></div>
</span>
</div> <div class="son">
<div class="son-input">
<img class="imgst" src="img/Group-2-copy.svg">
<input class="leftop" type="text">
</div>
<div class="son1">
<div class="as">00000000</div>
<div class="as">11111111</div>
<div class="as">22222222</div>
<div class="as">33333333</div>
<div class="as">44444444</div>
<div class="as">55555555</div>
<div class="as">66666666</div>
</div>
</div>
</div> </div>
<script>
if($('.all').length > 0) {
$('.all').on('click', function(e) {
var isShow = $(this).parents('.item').find('.son').is(':hidden');
isShow ? $(this).parents('.item').find('.son').slideDown(300) : $(this).parents('.item').find('.son').slideUp(300);
e.preventDefault();
e.stopPropagation();
});
}
if($('.as').length > 0) {
$('.as').on('click', function() {
$(this).parents('.item').find('.alla').text($(this).text());
$('.son').slideUp(300);
});
}
$(".leftop").on('click', function(e) {
e.preventDefault();
e.stopPropagation();
})
$(".imgst").on('click', function(e) {
e.preventDefault();
e.stopPropagation();
})
</script>
.all {
width: 100%;
height: 46px;
display: block;
position: relative;
color: rgba(255,255,255,1);
} .item {
width: 100%;
height: 100%;
background: #2b4071;
line-height: 48px;
border-left: 1px solid #2a404f;
cursor: pointer;
border: 1px solid #2f4a64;
border-radius: 3px;
} .alla {
margin-left: 10px;
font-size: 18px;
position: relative;
font-size: 14px;
} .as {
padding-left: 10px;
font-size: 14px;
} .as:hover {
background: #495689;
} .son {
width: 100%;
display: none;
background-color: #15284c;
position: absolute;
top: 48px;
z-index:;
} .item {
position: relative;
} .coinbig-c2c-sanj {
width:;
height:;
border-width: 7px;
border-style: solid;
border-color: #ffffff transparent transparent transparent;
background: #2b4071;
position: absolute;
right: 9px;
top: 20px;
} .zida {
font-size: 18px;
} .sonall {
width: 100%;
top: 48px;
} .imgst {
float: right;
width: 16px;
height: 16px;
margin-top: 12px;
margin-right: 10px;
} .leftop {
float: left;
width: 80%;
height: 100%;
border: none; background: #15284c;
color: #FFFFFF;
padding-left: 10px;
box-sizing: border-box;
} .son-input {
width: 90%;
height: 40px;
border: 1px solid #495d9a;
margin: 10px auto;
} .son1 {
overflow-y: auto;
max-height: 192px;
color: #EEEFF7;
} .son1::-webkit-scrollbar {
width: 3px;
height: 0px;
} .son1::-webkit-scrollbar-button {
background-color: #15284c;
}
.son1::-webkit-scrollbar-track {
background: #15284c;
} .son1::-webkit-scrollbar-thumb {
background: #2a404f;
border-radius: 10px;
} .son1::-webkit-scrollbar-corner {
background: #2a404f;
}
.alls {
width: 300px;
}
jq 下拉框的更多相关文章
- jq 下拉框获取选中自定义属性值
// 下拉框发送改变后 获取选择的信息 <div class="form-group"> <label class="col-sm-3 control- ...
- jq插件又来了,模拟select下拉框,支持上下方向键哦
好久没来了,更新下插件, 这个原理就是利用的 input[type='hidden']和自定义属性data-value捆绑传值操作的,可是设置默认选项,回调等参数,代码不多,比较简单,吼吼 (func ...
- jq实现简单的二级联动下拉框
1 效果图 2 html <!DOCTYPE html> <html lang="en"> <head> <meta charse ...
- jQ给下拉框绑定事件,为什么要绑定在框(select标签)上,而不是绑定在选项(option标签)上
这是我在学习锋利的 jquery 书中 5.1.4 的代码时遇到的一个小问题,源代码如下: <head> <style type="text/css"> * ...
- JQ与AJAX 省市区三级联动下拉框
用于初学者学习基本的联动下拉框,废话不多说,见代码 首先看控制器里的3个下拉框对应代码: public ActionResult GetProvinceList() { ProvinceReposit ...
- jq遍历 下拉框
var selectA1 = $("select[name=A1]"); //从A1下拉框中 搜索值 $(selectA1).children("option" ...
- jq select change下拉框选项变化判断选中值,添加(attr)或移除(removeAttr)一个或多个属性
select change下拉框选项变化判断选中值,添加(attr)或移除(removeAttr)一个或多个属性 $("#IsRecommend").change(function ...
- Jquery制作--美化下拉框
平常我们用的原生select下拉框,大部分样式没办法修改,导致在不同的浏览器里面会跟设计图的风格大相径庭.所以为了能让它美化起来,就用JQ模拟了一个下拉框,可以随意定义样式.原生的下拉框也保留在div ...
- easyui源码翻译1.32--Combo(自定义下拉框)
前言 扩展自$.fn.validatebox.defaults.使用$.fn.combo.defaults重写默认值对象.下载该插件翻译源码 自定义下拉框显示一个可编辑的文本框和下拉面板在html页面 ...
随机推荐
- uoj#37. 【清华集训2014】主旋律(状压dp+容斥)
传送门 第一眼容斥,然后我就死活容不出来了-- 记\(f_i\)为点集\(i\)中的点强联通的方案数,那么就是总的方案数减去使\(i\)不连通的方案数 如果\(i\)不连通的话,我们可以枚举缩点之后拓 ...
- IT兄弟连 Java语法教程 运行Java程序
编译好Java字节码文件后,接下来就应该运行Java程序了. 运行Java程序需要使用JDK中提供的java命令,因为已经把java命令所在的路径添加到了系统的Path环境变量中,因此现在可以直接使用 ...
- IT兄弟连 JavaWeb教程 经典案例
案例需求:编写一个jsp servlet程序,在login.jsp发起login.do登录请求,当输入的用户名是abc密码是123时,则判断是登录成功,其它暂时认为是登录失败.当用户登录成功时,将用户 ...
- JS数组去重精简版
看了很多人写的好几个去重方法,我在这里精简组合下,适用于已排序与未排序的数组. 废话不多说,上代码. <!DOCTYPE html> <html> <head> & ...
- 《SQL 进阶教程》 case:在 CASE 表达式中使用聚合函数
1.只加入一个社团的学生的社团id select std_id, max(club_id) from student_clubgroup by std_idhaving count(*) =1---- ...
- linux查看系统版本(适用于centos、ubutun,其他类型没有进行测试)
方法一:cat /etc/issue 或more /etc/issue root@salt-master:~# cat /etc/issueUbuntu 16.04.2 LTS \n \l 方法二:l ...
- js 中止程序继续进行(break continue return throw)
1.break 跳出循环 2.continue 跳出本次循环,进入下次循环 3.return 中止当前函数继续执行 4.throw 异常信息;中止程序抛出异常,可用于中止程序
- Codeforces Round #561 (Div. 2) A. Silent Classroom
链接:https://codeforces.com/contest/1166/problem/A 题意: There are nn students in the first grade of Nlo ...
- loj2734「JOISC 2016 Day 2」女装大佬 || 洛谷P3615 如厕计划
loj2734 洛谷P3615 http://218.5.5.242:9021/problem/185 不会做... 题解(来自ditoly): 这一步更详细的解释(来自kkksc03): 还是从后面 ...
- python 8 函数
调用函数 Python内置了很多有用的函数,我们可以直接调用. 要调用一个函数,需要知道函数的名称和参数,比如求绝对值的函数abs,只有一个参数.可以直接从Python的官方网站查看文档: 也可以在交 ...