随笔分类 -  Jquery

javascriptDOM库
摘要:引入noConflict(),将$替换为其他符号 阅读全文
posted @ 2017-11-01 10:42 xuanPhoto 阅读(211) 评论(0) 推荐(0) 编辑
摘要:尽量不要使用parent去获取DOM元素,如下代码: var $activeRows = $this.parent().parent().children(".active"); 这样的代码扩展性不好,一旦DOM结构发生改变,这里的逻辑分分钟会挂,如某天你可能会套了个div用来清除浮动,但是没想到导致有个按钮点不了了就坑爹了。 应该用closest,如: var $activeRow... 阅读全文
posted @ 2017-08-26 15:35 xuanPhoto 阅读(188) 评论(0) 推荐(0) 编辑
摘要:排除与选入 调用选取的结果 html部分 div class="box"> <div class="divColor"> 1 </div> <div class="divColor"> 2 </div> <div class="divColor"> 3 </div> <div class="divC 阅读全文
posted @ 2017-06-26 17:43 xuanPhoto 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-06-22 15:16 xuanPhoto 阅读(177) 评论(0) 推荐(0) 编辑
摘要:html打印结果子元素以及自身 <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <style type="text/css"> .demo{width: 300px;height: 200px;border 阅读全文
posted @ 2017-06-21 14:10 xuanPhoto 阅读(155) 评论(0) 推荐(0) 编辑
摘要:css html javascript 阅读全文
posted @ 2017-06-20 13:24 xuanPhoto 阅读(259) 评论(0) 推荐(0) 编辑
摘要:随机取数方法 Math.random() 表示0到1之间随机取一个数 0<x<1 小数 Math.random()*5 表示0<x<5 parseInt(Math.random()*5) 0 1 2 3 4 中随机取一个数 公式:表示0到n 的随机取数(整数) parseInt(Math.random()*(n+1)) 阅读全文
posted @ 2017-06-19 12:05 xuanPhoto 阅读(212) 评论(0) 推荐(0) 编辑
摘要:test function demo(){ return function test(a){ alert($(a).text()) } } demo() 阅读全文
posted @ 2017-06-15 11:36 xuanPhoto 阅读(175) 评论(0) 推荐(0) 编辑
摘要:function test(a){ console.log(a)} 阅读全文
posted @ 2017-06-06 14:22 xuanPhoto 阅读(177) 评论(0) 推荐(0) 编辑
摘要:遍历json数据 json数据 阅读全文
posted @ 2017-05-23 12:09 xuanPhoto 阅读(201) 评论(0) 推荐(0) 编辑
摘要:点击 点击 点击 阅读全文
posted @ 2017-05-08 10:56 xuanPhoto 阅读(578) 评论(0) 推荐(1) 编辑
摘要:1 2 3 阅读全文
posted @ 2017-05-06 16:40 xuanPhoto 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Document 解绑 绑定 点击测试 阅读全文
posted @ 2017-04-19 20:05 xuanPhoto 编辑
摘要:css js 阅读全文
posted @ 2017-04-09 15:21 xuanPhoto 阅读(259) 评论(0) 推荐(0) 编辑
摘要://原生js window.onresize = function() { console.log(document.body.clientWidth); } // jq方式 $(window).resize(function(){ console.log($(document.body).widt 阅读全文
posted @ 2017-04-09 11:40 xuanPhoto 编辑
摘要:用.css获取和便捷函数的区别 阅读全文
posted @ 2017-01-18 18:24 xuanPhoto 编辑
摘要:判断是否被选中 点击关联复选框 阅读全文
posted @ 2017-01-18 18:23 xuanPhoto 编辑
摘要:基本选择器 通过id class 标签名来查找dom元素 层次选择器 例如后代选择器 子元素 相邻元素 同辈元素等 过滤选择器 过滤规则和css中的伪类选择器语法相同,及选择其以冒号(:)开头 按照不同的规则又分为基本过滤 可见性过滤 属性过滤 子元素过滤和变淡过滤等 表单选择器 阅读全文
posted @ 2017-01-18 18:17 xuanPhoto 编辑
摘要:attr就集合原生js的setattrbute和getattrbute两种属性 p标记 阅读全文
posted @ 2017-01-18 18:12 xuanPhoto 阅读(157) 评论(0) 推荐(0) 编辑
摘要:正常的冒泡 用返回值false阻止冒泡 用内置函数停止事件冒泡 阅读全文
posted @ 2017-01-18 18:08 xuanPhoto 编辑

点击右上角即可分享
微信分享提示