zoukankan
html css js c++ java
JQUERY 展开收起显示隐藏效果
<!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="http://www.mengdongli.com/skins/2012/js/jquery1.3.2.js"></script> <style> .text{line-height:22px;padding:0 6px;color:#666;} .box h1{padding-left:10px;height:22px;line-height:22px;background:#f1f1f1;font-weight:bold;} .box{position:relative;border:1px solid #e7e7e7;} </style> </head> <body> <script type="text/javascript"> // 收缩展开效果 $(document).ready(function(){ // $(".box h1").toggle(function(){ // $(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow"); // },function(){ //$(this).next(".text").animate({height: 'toggle', opacity: 'toggle'}, "slow"); //}); $("div.text").hide();//默认隐藏div,或者在样式表中添加.text{display:none},推荐使用后者 $(".box h1").click(function(){ $(this).next(".text").slideToggle("slow"); }) }); </script> <!-- 收缩展开效果 --> <div class="box"> <h1>收缩展开效果</h1> <div class="text"> 1<br /> 2<br /> 3<br /> 4<br /> 5<br /> </div> </div> <br /> <div class="box"> <h1>收缩展开效果</h1> <div class="text"> 1<br /> 2<br /> </div> </div> <br> 第一次运行请刷新一下页面。 </body> </html>
运行代码
复制代码
另存代码
提示:您可以先修改部分代码再运行
查看全文
相关阅读:
hibernate 数据处理
oracle函数
TCP聊天工具
Hibernate批量处理数据、HQL连接查询
Hibernate二级缓存配置
Hibernate一对一关联映射配置
Hibernate延迟加载
Hibernate双向多对多关联
06章 映射一对多双向关联关系、以及cascade、inverse属性
映射对象标识符
原文地址:https://www.cnblogs.com/liuzhuqing/p/7480657.html
最新文章
Mybatis(综合案例)
网络爬虫(密码破解)
错题集07
二进制 八进制 十进制 十六进制之间的转换
深入.NET平台和C#编程 错题录
体检套餐管理系统 05章
深入.NET框架 项目--魔兽登录系统
捡拾幸福的拾荒者
事务&视图和索引
高级查询与两套分页总结
热门文章
用Access作为后台数据库支撑,书写一个C#写入记录的案例
沙漏图形
关于一个类中方法调用情况
no-proxy 和proxy 的区别
extra增强延迟加载
单向一对多,双向一对多,双向多对多
inverse理解
关联关系
ThreadLocal
save(),saveorupdate()还有marqe()
Copyright © 2011-2022 走看看