select随笔
粘贴下面代码
select 美化
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<style>
body,ul{
margin:0;
padding: 0;
background: #1D9669;
}
.content{
padding-top:5%;
}
.content .select-wrap{
width:300px;
height:40px;
font-size: 16px;
margin: 0 auto;
background: #fff;
position: relative;
}
.content .select-wrap:after{
content: '';
display: block;
width: 10px;
height: 10px;
border-left:1px #000 solid;
border-bottom:1px #000 solid;
transform: rotate(-45deg);
position: absolute;
top:11px;
right: 12px;
}
.content .select-wrap .title{
padding: 0 15px;
line-height:40px;
cursor: pointer;
}
.content .select-wrap ul{
list-style-type: none;
background-color: #fff;
width: 100%;
overflow-y: auto;
top:40px;
position: absolute;
left:0;
max-height: 0;
}
.content .select-wrap ul li{
padding: 0 15px;
line-height:40px;
cursor: pointer;
}
.content .select-wrap ul li:hover{
background-color: #e0e0e0;
}
.content .select-wrap .selected{
background: #39f;
color: #fff;
}
.content .open ul{
max-height: 250px;
}
.content .open:after{
transform: rotate(-225deg);
top:18px;
transition: all .3s ease-in;
}
</style>
<script>
$(function () {
$(".select-wrap").on("click",function () {
$(this).toggleClass("open");
}); var liItem = $(".select-wrap ul li");
liItem.on("click",function () {
var $this = $(this);
liItem.removeClass("selected");
$this.addClass("selected");
$(".title").text($this.text());
$(".selected").text($this.text()).attr("data-value",$this.attr("data-value"));
})
})
</script>
<body>
<div class="content">
<div class="select-wrap">
<p class="title">请选择</p>
<ul>
<li data-value="HTML">HTML</li>
<li data-value="CSS">CSS</li>
<li data-value="JS">JS</li>
<li data-value="PHP">PHP</li>
</ul>
</div>
</div> </body>
</html>


select随笔的更多相关文章
- 最全的ORACLE-SQL笔记
-- 首先,以超级管理员的身份登录oracle sqlplus sys/bjsxt as sysdba --然后,解除对scott用户的锁 alter user scott account unloc ...
- Matplotlib数据可视化(6):饼图与箱线图
In [1]: from matplotlib import pyplot as plt import numpy as np import matplotlib as mpl mpl.rcParam ...
- jquery 获取和设置 checkbox radio 和 select option的值?
============== 获取和设置 checkbox radio 和 select的值? === val()函数, 其名字就表达了 它的意思: 他就是= value 的简写! val就是valu ...
- php随笔(一)
之前的开发一直用的都是Thinkphp框架,对原生的php很不了解,近日打算把以前的项目拿一个出来用原生php再重写一次,顺便再把TP框架拆开好好分析分析. 之前的android开发虽说对面向对象的思 ...
- MyBitis(iBitis)系列随笔之五:多表(一对多关联查询)
MyBitis(iBitis)系列随笔之一:MyBitis入门实例 MyBitis(iBitis)系列随笔之二:类型别名(typeAliases)与表-对象映射(ORM) MyBitis(iBitis ...
- SQL学习之SELECT子句顺序
下面来总计下之前的随笔中所说过的所有的SELECT子句的顺序. 子句 说明 是否必须使用 SELECT 要返回的列或者表达式 ...
- 开发随笔——NOT IN vs NOT EXISTS
原文:开发随笔--NOT IN vs NOT EXISTS 原文出处: http://blog.csdn.net/dba_huangzj/article/details/31374037 转载请引用 ...
- MongoDB入门系列(三):查询(SELECT)
一.概述 mongodb是最接近关系型数据库的NOSQL数据库,它的存储方式非常的灵活:以至于你会将它看成是一个经过冗余过的关系型数据库的表,这也是Mongodb原子性的一个特征.由于没有关系型数据库 ...
- 关于Mybatis的一些随笔
Mapper.xml头文件 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http:/ ...
随机推荐
- jQuery-图片的放大镜显示效果(需要大小图)
1.default.aspx <%@ Page Language=.2em; height:.1em; text-align:center; font-size:128px;} .zxx_ ...
- PagerSlidingTabStrip(viewPage滑动菜单)
Github地址:https://github.com/astuetz/PagerSlidingTabStrip 1,Include the library dependencies { compil ...
- SQL查询语句 [1]
一.使用字符串作为条件查询 在 Home/controller/UserController.class.php 下插入 <?php namespace Home\Controller; use ...
- C++面向对象类的实例题目十
题目描述: 编写一个程序,其中有一个汽车类vehicle,它具有一个需要传递参数的构造函数,类中的数据成员:车轮个数wheels和车重weight放在保护段中:小车类car是它的私有派生类,其中包含载 ...
- Vue02 样式的动态绑定
daigengxin......2018-3-8 21:09:18 跟angular2类似,分为CSS类绑定和Style样式绑定两种方式,详情参见
- Python 黑客 004 用Python构建一个SSH僵尸网络 01 简介
用Python构建一个SSH僵尸网络 01 简介 一. 构建一个SSH僵尸网络的流程图: Created with Raphaël 2.1.0手动操作,实现通过SSH连接目标服务器(手动)用 Pexp ...
- PCL—关键点检测(iss&Trajkovic)低层次点云处理
博客转载自:http://www.cnblogs.com/ironstark/p/5069311.html 关键点检测往往需要和特征提取联合在一起,关键点检测的一个重要性质就是旋转不变性,也就是说,物 ...
- C语言-郝斌笔记-003数据类型
基本类型数据 整数 整型 —— int --4字节 短整型 —— short int ——2字节 长整型 —— long int ——8字节 浮点数[实 ...
- python3-while与if
# Auther: Aaron Fan age_of_oldboy = 56 #定义一个while循环的起始判断值countcount = 0#当count小于3的情况下一直执行while循环whil ...
- Ubuntu jdk安装详细
安装jdk步骤: 1.首先连接130的ip地址,进去Tools拷贝jdk压缩文件(Tools中已经有下载好的jdk版本,也可自己另行下载) 2.将拷贝好的压缩文件解压 tar -zxvf 压缩文件名 ...