仿苹果 html5 combox,模仿combox(select)控件,不用为美化select烦恼了。
模仿combox(select)控件,不用为美化select烦恼了。
来源:中文源码网 浏览: 次 日期:2018年9月2日
模仿combox(select)控件,不用为美化select烦恼了。 不用整天为美化select控件烦恼了。 1、可批量美化select控件。 2、可以有onchange句柄。 3、触发onchange的函数可带参数。 3、可以得到select的值。 4、可设置像select类似的滚动条(如大于或等于8个数目时出现滚动条) 5、可设置宽度和高度 API参考: //首先生成一个simulateSelect的实例 //构造函数的第一个可选参数为触发onchange的函数,其它的为onchange函数的参数; c = new simulateSelect(s1onchange, "never-online"); //设置select的CSS,第一个参数为控件的主要CSS、第二个为选中条目时的CSS、第三个为没有选中条目时的CSS c.style("CtlSelect2", "selected2", "unselected2"); //设置select的宽度和高度; c.width = 320; c.height = 20; //初始化参数为:select控件的ID,可以用逗号分离,进行批量转换; c.init("s1,s2,s3"); 下一版本将可修改combox
simulate combox control - http://www.never-online.net
body, input
{
font-family: verdana;
font-size: 9pt;
}
h1
{
font-family: tahoma;
font-size: 22pt;
text-align: left;
}
pre
{
font-size: 9pt;
font-family: verdana;
border: 1px solid #006600;
width: 400px;
padding: 10px;
background: #ffffff;
color: #006600;
}
.CtlSelect
{
border: 1px solid #006600;
font-family: verdana;
height: 20px;
color: #006600;
background: #ffffff;
/*background:url({E5066804-650D-4757-9BA4-A92DB8817A18}0.jpg);*/
}
.selected
{
background: #006600;
color: #ffffff;
height: 20px;
}
.unselected
{
height: 20px;
color: #006600;
line-height: 120%;
border-bottom: 1px solid #006600;
}
.CtlSelect1
{
border: 1px solid #003399;
font-family: verdana;
height: 20px;
color: #003399;
background: #ffffff;
/*background:url({E5066804-650D-4757-9BA4-A92DB8817A18}0.jpg);*/
}
.selected1
{
background: #003399;
color: #ffffff;
height: 20px;
}
.unselected1
{
height: 20px;
color: #003399;
line-height: 120%;
border-bottom: 1px solid #003399;
}
.CtlSelect2
{
border: 1px solid #990000;
font-family: verdana;
height: 20px;
color: #990000;
background: #ffffff;
/*background:url({E5066804-650D-4757-9BA4-A92DB8817A18}0.jpg);*/
}
.selected2
{
background: #990000;
color: #ffffff;
height: 20px;
}
.unselected2
{
height: 20px;
color: #990000;
line-height: 120%;
border-bottom: 1px solid #990000;
}
.copyright
{
margin-top: 10px;
font-size: 9pt;
text-align: center;
color: #333;
font-weight: bold;
}
simulate combox control
demonstrate
normal select:
- please select your options -
option1
option2
option3
option4
option5
simulate select:
- please select your options -
1option1
1option2
1option3
1option4
1option5
scroll simulate select:
- please select your options -
2option1
2option2
2option3
2option4
2option6
2option7
2option8
2option9
2option10
2option11
2option12
2option13
2option14
onchange handler fire:
- please select your options -
3option1
3option2
3option3
3option4
3option5
Get value
append item
remove item description
//-------------------------------------------------------------
// @ Module: simulate select control, IE only.
// @ Debug in: IE 6.0
// @ Script by: blueDestiny, never-online
// @ Updated: 2006-3-22
// @ Version: 1.0 apha
// @ Email: blueDestiny [at] 126.com
// @ Website: http://www.never-online.net
// @ Please Hold this item please.
//
// API
// @ class: simulateSelect()
//
// @ object.style(ctlStyle[,selStyle][,unselStyle])
// ctlStyle: main control combox css class name
// selStyle: when mouseover or option focus css class name
// unselStyle: options blur's css class name
//
// @ object.width=(widthPX)
// widthPX must be a digit number.
//
// @ object.height=(heightPX)
// heightPX must be a digit number.
//
// @ object.getValue(ctlSelID)
// ctlSelID is the unique select control ID
//
// -------------- for the next Version ----------
// @ object.readOnly = (blnReadOnly)
// blnReadOnly must be a boolean type or a number type.
// @ object.addEvent(w, h)
// w: fire handler's event.
// h: handler function.
//-------------------------------------------------------------
Power By blueDestiny, never-online
http://www.never-online.net
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
亲,试试微信扫码分享本页! *^_^*
仿苹果 html5 combox,模仿combox(select)控件,不用为美化select烦恼了。相关推荐
- HTML select控件
select控件 select控件用于创建下拉列表框(下拉菜单),并通过 option 元素创建列表中的选项,供用户从中选择. 定义 select控件时,在 select元素中设置 name 属性,并 ...
- 新一代HTML5开发工具Wijmo子控件详解
概述:ComponentOne Studio for ASP.NET Wijmo拥有40多个不同风格的高性能且易于使用的控件,这些控件都基于常用的Web标准,如AJAX, CSS,HTML5和jQue ...
- JavaScript操作select控件
<!DOCTYPE html> <html lang="en"> <head><meta charset="UTF-8" ...
- html下拉列表插件,js+CSS实现模拟华丽的select控件下拉菜单效果
本文实例讲述了js+CSS实现模拟select控件的下拉菜单效果.分享给大家供大家参考.具体如下: 这是一个JS+CSS技术实现的Select控件效果,模拟出来的,比默认的Select更漂亮,有了这个 ...
- Select控件实现联动下拉列表框效果
Select控件实现联动下拉列表框效果(无需数据库) Select控件属性介绍: ID属性:获取或设置分配给Select控件的编程标识符. Name属性:获取或设置与Select控件关联的唯一标识符. ...
- 菜单向上拉html,模拟select控件,CSS上拉菜单
模拟select控件,CSS下拉菜单 模拟select控件 html,body{height:100%;overflow:hidden;} body,div,form,h2,ul,li{margin: ...
- 以编程方式在ASP.NET MVC中使用多个HTML Select控件
目录 介绍 使用代码 使用JQuery 使用Razor和C# 兴趣点 介绍 很多时候,我们使用JavaScript或JQuery代码来操纵HTML控件,却不知道ASP.NET MVC与Razor和C# ...
- Selenium处理Select控件
Selenium处理Select控件 1.介绍: 在进行Web应用自动化测试的过程中,Select下拉框是我们经常会操作的控件,Selenium针对这种控件封装了Select类供我们测试使用.当然,也 ...
- 高仿钉钉和小米的日历控件
CalendarExaple 项目地址:codbking/CalendarExaple 简介:高仿钉钉和小米的日历控件 更多:作者 提 Bug 示例 APK 标签: CalendarVi ...
最新文章
- python窗口化编程_python程序的窗口化
- 读写分离,读写分离死锁解决方案,事务发布死锁解决方案,发布订阅死锁解决方案|事务(进程 ID *)与另一个进程被死锁在 锁 资源上,并且已被选作死锁牺牲品。请重新运行该事务...
- 如何看懂ORACLE执行计划
- filter与servlet对照
- HTTP请求方式中GET和POST的区别?
- 华为p50出厂自带鸿蒙,真的假的?华为P50系列出厂就预装鸿蒙
- 台式计算机颜色如何矫正,台式机怎么颜色校正操作教程
- prolog寻找三角形个数
- ireport 循环_IReport 常见问题整理
- 使用FFMPEG 模仿微信拍视频
- 如何实现可多人协作的“在线excel”系统?
- java 3D 第二章 java 3D基本概念
- IDM UltraEdit编辑器V26.00.0.48 烈火汉化64位版
- 2019互联网校招薪资表: BAT、华为还没有TMD高
- Python快速爬虫技巧
- 嵌入式 IIC(I2C)协议
- 深夜爬虫, 我很抱歉 , 附爬取“网抑云”最详细的爬虫教程!
- Images to Video(图片转视频软件)v4.0官方版
- 《奇点来临》——Linked-In上“奇点临近”论坛的观点
- DirectX (9) 纹理映射
热门文章
- SQL相关子查询是什么?和嵌套子查询有什么区别?
- Excel技巧—瞬间吸引眼球的WIFI图表
- Python量化:获取历史行情数据并计算KDJ指标
- Python的matplotlib库学习笔记第一篇
- 一文说透容器跨主机网络
- js 鼠标事件总结 mouseover/mouseout 与mouseenter/mouseleave 傻傻分不清楚?
- 华为鸿蒙电视智慧屏,华为鸿蒙助力荣耀智慧屏,让大屏功能秀起来
- VS Code 开发asp.net.web.API,C#后端开发
- 沙特SASO2927能效与SASO2902的区别
- 配置Jenkins使用exmail服务发送邮件