摘要: 1、 $('i1').height() # 获取标签的高度 纯高度$('i1').innerHeight() # 获取边框 + 纯高度 + ?$('i1').outerHeight() # 获取边框 + 纯高度 + ?$('i1').outerHeight(true) # 获取边框 + 纯高度 + 阅读全文
posted @ 2020-04-24 20:25 凸凸yolotheway 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1、$.extend() (a) <script> $.extend({ 'ws':function(){ return'sb'; //ws为方法名 } }); var v=$.ws(); alert(v); //执行该函数时,弹出框会弹出 sb </script> (b)也可以将$.extend的 阅读全文
posted @ 2020-04-24 20:14 凸凸yolotheway 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1、表单验证 表单验证使用到了18章节的 return false与return true css代码: <style> .error{ color: red; } </style> html代码: <form id="f1" action="14--对11模态编程框实现删除功能.html" met 阅读全文
posted @ 2020-04-24 20:03 凸凸yolotheway 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 1、jquery中使用return false来阻止事件的发生 以两个超链接为例: html代码如下: <a onclick="return ClickOn();" href="http://www.baidu.com">百度</a> <a id="i1" href="http://www.baid 阅读全文
posted @ 2020-04-24 19:49 凸凸yolotheway 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 1、对jquery高度及位置操作 $(window).scrollTop() 获取位置 $(window).scrollTop(0) 设置位置 <div id="i1"></div> <div style="width: 200px;height: 200px;overflow: auto;"> < 阅读全文
posted @ 2020-04-23 19:58 凸凸yolotheway 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 1、点击赞的字样时,会出现“+1”样式,并且+1样式逐渐变大,透明度逐渐变小,最后该字样消失(透明度为0) (1)css代码: <style> .container{ padding: 50px; border: 1px solid black; } .item{ position: relativ 阅读全文
posted @ 2020-04-21 18:20 凸凸yolotheway 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 1、11章节源代码: (1)css代码: .modal{ position: fixed; top: 50%; left: 50%; width: 500px; height: 400px; margin-top: -250px; margin-left: -250px; background-co 阅读全文
posted @ 2020-04-21 18:12 凸凸yolotheway 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1、本节学习了jquery中对文档的处理 追加有四种方式:向前追加 append before;向后追加 prepend after 全部移除 remove ;清空内容 empty; 克隆 clone (1)四种追加方式 现在页面编写一个输入框,一个添加按钮,在写入一个列表,当点击“添加”按钮时,该 阅读全文
posted @ 2020-04-21 12:32 凸凸yolotheway 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1、对08章节的模态框进行优化 08章节的模态框,通过读取td标签的内容来实现,还使用了索引; 这样的缺点是 当在某个位置插入td标签时,jquery中读取td标签内容的代码均需要进行调整; (1)将08模态框中的td标签加上一个target属性,html代码如下: <a onclick="addE 阅读全文
posted @ 2020-04-10 19:41 凸凸yolotheway 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1、样式操作toggleClass 以开关灯为例,点击一下,出现某个内容;在点击一下,该内容隐藏;该内容默认是隐藏的 (1)html代码如下: <input type='checkbox' id='i2' /> <input id="i1" type="button" value="开关" /> < 阅读全文
posted @ 2020-04-08 20:27 凸凸yolotheway 阅读(150) 评论(0) 推荐(0) 编辑