您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

jQuery实现点击显示内容下拉效果

2024/3/2 3:35:06发布14次查看
本文主要介绍了jquery基于事件控制实现点击显示内容下拉效果,涉及jquery事件响应及元素属性动态操作相关技巧,需要的朋友可以参考下,希望能帮助到大家。
1、实例代码:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>jquery事件</title> <script type="text/javascript" src="jquery-1.7.2.min.js"></script> <style type="text/css"> body{ font-family:微软雅黑; font-size:12px; font-stretch:normal; background-color:!important; width:400px; height:auto; } .total{ border:#00ff00 solid 1px; font-size:12px; } .module{ padding:6px; font-size:14px; font-weight:bolder; background-color:#fc6; } .content{ padding:8px; font-size:12px; font-family:微软雅黑; text-align:center; display:none; } .open{ background-color:#0000ff; } </style> <script type="text/javascript"> $(function(){ $(".content").html("你好,欢迎来到脚本之家!"); $(".module").click(function(){ $(this).addclass("open").next(".content").css("display","block"); $(this).css("color","#fffff"); }); }); </script> </head> <body> <p class="total"> <p class="module">模块</p> <p class="content"></p> </p> </body> </html>
2、实例结果:
(1)初始化
(2)点击“模块”
相关推荐:
js实现点击循环切换显示内容的方法
angular实现日程表功能(可添加及隐藏显示内容)详解
angular4中如何显示内容的css样式示例代码
以上就是jquery实现点击显示内容下拉效果的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product