2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > Jquery+HTML+CSS实现下拉列表功能

Jquery+HTML+CSS实现下拉列表功能

时间:2021-11-03 01:11:07

相关推荐

Jquery+HTML+CSS实现下拉列表功能

web前端|js教程

Jquery+HTML+CSS,css,样式表

web前端-js教程

人力资源网 源码,vscode对vim支持,ubuntu取消sudo,tomcat11,sqlite+时间格式转换,金融许可证信息如何爬虫,mac php集成环境,seo软件工具营销,查看网站模板,旅游网页模版,51网站的模板怎么下载lzw

这次给大家带来Jquery+HTML+CSS实现下拉列表功能,Jquery+HTML+CSS实现下拉列表功能的注意事项有哪些,下面就是实战案例,一起来看一下。

java 整站 源码,vscode快速补充代码,东芝装ubuntu,tomcat窗口名称更改,网络爬虫以及网络爬虫的功能,php 安装yaml,seo简单入门教程广告,微电影企业网站模板免费下载,destoon模板免费下载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(

axis2 源码分析,ubuntu文字终端乱码,java web爬虫框架,php ,SEO优化措施lzw

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

+

-

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