700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 关于jquery+css实现下拉列表功能的实例详解

关于jquery+css实现下拉列表功能的实例详解

时间:2019-09-23 17:20:25

相关推荐

关于jquery+css实现下拉列表功能的实例详解

web前端|js教程

jquery+css,css,样式表

web前端-js教程

本文通过实例代码给大家介绍了jquery 与css相结合实现的下拉列表功能,非常不错,具有参考借鉴价值,需要的朋友参考下吧,希望能帮助到大家。

源码 装饰,vscode实验报告,ubuntu 无线设置,tomcat要如何搭建,乳白爬虫,php链接mssql,黄冈高效seo推广公司,网站轮播特效下载,小说 手机 网站模板下载 迅雷下载lzw

废话不多说了,直接给大家贴代码了,具体代码如下所述:

商城源码ecshop,ubuntu 绿色软件,爬虫抓取达盖尔,串口php,google seo 算法lzw

p2p贷款 源码,vscode插件配置教程,Ubuntu升级步骤,aix tomcat6,ofo爬虫,php获取文件名后缀,衢州seo优化几个要点,网站购物车源码,wordpress 自带模板下载lzw

fruit.hide { display: none;}p { float: left; width: 100%;}.selector-containter { margin-bottom: 10px;}.selector { width: 200px; background: #FFF; border: 1px solid #DDD;}.selector-hint { width: 178px; border: 1px solid #DDD;}.selector-expand { width: 8px; border: 1px solid #DDD;}.selector-collapse { width: 8px; border: 1px solid #DDD;}$(document).ready(function() { //使用on方法,采用事件委派机制,selector-option-container中的内容为后续动态追加 $(.selector).on(click, .selector-expand, function() { $(this).parent().children(.selector-option-container).children().remove(); $(this).parent().children(.selector-option-container).append(

apricot

); $(this).parent().children(.selector-option-container).append(

banana

); $(this).nextAll(.selector-option-container).removeClass(hide); }); $(.selector).on(click, .selector-collapse, function() { $(this).nextAll(.selector-option-container).addClass(hide); }); $(.selector-t1).on(click, .selector-option, function() { $(this).parent().parent().children(.selector-hint).text($(this).text()); $(this).parent().addClass(hide); }); $(.selector-t1).on(click, .selector-checkbox, function() { $(this).parent().parent().parent().children(.selector-hint).text($(this).parent().next().text()); //采用prop方法,对于值为布尔型的属性赋值 $(this).prop(checked, false); $(this).parent().parent().addClass(hide); });});

select fruit

+

-

select fruit

+

-

微信小程序显示下拉列表功能的实现方法

关于Vue.js表单标签中的单选按钮、复选按钮和下拉列表的取值详解

原生js实现下拉列表框

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。