爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
带图片下拉菜单
带图片下拉菜单
日期:2014-05-18 浏览次数:20269 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
脚本说明: 把如下代码加入<body>区域中 <style type=text/css> .select { BORDER-BOTTOM: buttonface 0px inset; BORDER-LEFT: buttonface 0px inset; BORDER-RIGHT: buttonface 0px inset; BORDER-TOP: buttonface 0px inset; CURSOR: default; FONT: icon; WIDTH: 100px } .selected { BACKGROUND: window; BORDER-BOTTOM: buttonface 0px inset; BORDER-LEFT: buttonface 0px inset; BORDER-RIGHT: buttonface 0px inset; BORDER-TOP: buttonface 0px inset; FONT: icon; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px } .selectTable { BACKGROUND: buttonface; BORDER-BOTTOM: buttonhighlight 2px inset; BORDER-LEFT: buttonhighlight 2px inset; BORDER-RIGHT: buttonhighlight 2px inset; BORDER-TOP: buttonhighlight 2px inset; HEIGHT: 100%; WIDTH: 100% } .option { FONT: icon; PADDING-BOTTOM: 1px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 1px; WIDTH: 100% } .dropDown { BACKGROUND: window; BORDER-BOTTOM: windowtext 1px solid; BORDER-LEFT: windowtext 1px solid; BORDER-RIGHT: windowtext 1px solid; BORDER-TOP: windowtext 1px solid; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px; POSITION: absolute; VISIBILITY: hidden; WIDTH: 100% } .select .button { BORDER-BOTTOM: buttonhighlight 2px outset; BORDER-LEFT: buttonhighlight 2px outset; BORDER-RIGHT: buttonhighlight 2px outset; BORDER-TOP: buttonhighlight 2px outset; FONT-FAMILY: webdings; FONT-SIZE: 11px; HEIGHT: 5px; PADDING-BOTTOM: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; PADDING-TOP: 0px; WIDTH: 16px } </style> <SCRIPT type=text/javascript> var overOptionCss = "background: highlight; color: highlighttext"; var sizedBorderCss = "2 inset buttonhighlight"; var globalSelect; //This is used when calling an unnamed selectbox with onclick="this.PROPERTY" var ie4 = (document.all != null); var q = 0; function initSelectBox(el) { copySelected(el); var size = el.getAttribute("size"); // These two lines combined with execution in optionClick() allow you to write: // onchange="alert(this.options[this.selectedIndex].value)" el.options = el.children[1].children; el.selectedIndex = findSelected(el); //Set the index now! // Some methods that are supported on the real SELECT box el.remove = new Function("i", "int_remove(this,i)"); el.item = new Function("i", "return this.options[i]"); el.add = new Function("e", "i", "int_add(this, e, i)"); // The real select box let you have lot of options with the same NAME. In that case the item // needs two arguments. When using DIVs you can't have two with the same NAME (or ID) and // then there is no need for the second argument el.options[el.selectedIndex].selected = true; dropdown = el.children[1]; if (size != null) { if (size > 1) { el.size = size; dropdown.style.zIndex = 0; initSized(el); } else { el.size = 1; dropdown.style.zIndex = 99; if (dropdown.offsetHeight > 200) { dropdown.style.height = "200"; dropdown.style.overflow = "auto"; } } } highlightSelected(el,true); } function int_remove(el,i) { if (el.options[i] != null) el.options[i].outerHTML = ""; } function int_add(el, e, i) { var html = "<div class='option' noWrap"; if (e.value != null) html += " value='" + e.value + "'"; if (e.style.cssText != null) html += " style='" + e.style.cssText + "'"; html += ">"; if (e.text != null) html += e.text; html += "</div>" if ((i == null) || (i >= el.options.length)) i = el.options.length-1; el.options[i].insertAdjacentHTML("AfterEnd", html); } function initSized(el) { //alert("initSized -------->"); var h = 0; el.children[0].style.display = "none"; dropdown = el.children[1]; dropdown.style.visibility = "visible"; if (dropdown.
上一篇:狡猾的按钮特效
下一篇:用select作导航条
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
HTC与苹果三星距离扩展 C2B形式成新武器
微软史上最大规模裁员,一半诺基亚员工
美国政府关门可能影响去哪儿等公司IPO
马云的SNS之梦有了新目标 收购“微博”
北京今日实现用支付宝钱包为公交卡充值
欧洲6万人起诉Facebook隐私侵权
一大波智能路由器正在袭来:小米、360、极路由大PK
团购网站存活率仅18.6% 剩余缺乏千家
特斯拉将获上海免费牌照 充电桩面临双重标准
推荐阅读
更多>
网友爆料称微软雇水军宣传主机Xbox One
苹果大中华区业绩回暖 中移动贡献或低于预期
英特尔IDF峰会启示:释放移动互联的信号
Android应用审核乱象:诈骗软件冲上排行榜首
用友软件股价逆势下跌 再融资方案现曙光
广东移动高层受调查 中移动或现更大反腐风暴
充斥着假消息负能量的“秘密”缺乏普适性
阿里马云:我觉得互联网还有十年可以做
微软觊觎移动互联市场:手机未出渠道先行
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
三问刘强东:京东为何近来火气这么大?
谷歌新技术进入iOS平台:将叫板苹果Siri
打车软件竞争白热化:有冷兵器时代意味
巨人网络回应央视 否认应用黑客停止诈骗
中电信国际漫游费下调85% 世界杯上网28元/天
广电地方营业厅的一句“罚停”,暴露出了他们的本质
逆转猜想:如果阿里成为雅虎大股东会怎样?
MIUI,有了它小米就无惧对手
论:三大运营商运用商店逆袭并非不能够
虚拟运营商们更像三大运营商的“二道贩子”