摘要: 监听window键盘的事件: (如监听shift按下)(keydown,keyCode) //定义全局变量,监听键盘的shift是否被按下,shift对应的码是16 var flag=false; //注意是window对象,e是事件本身 $(window).on("keydown",function (e) { if(e.keyCode 16){ falg=true; } }); #--按住sh 阅读全文
posted @ 2019-09-25 20:37 LBC不认输 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 1. 文档操作 创建标签用:document.createElement("div") 1. 内部添加 1. 前面加 1. $(A).prepend(B) 2. $(A).prependTo(B) 2. 后面加 1. $(A).append(B) 2. $(B).appendTo(A) 2. 外部添加 1. 前面加 1. $(A).before(B) 2. $(B).insertBefore(A) 阅读全文
posted @ 2019-09-25 20:37 LBC不认输 阅读(293) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="x-ua-compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>点赞 阅读全文
posted @ 2019-09-25 20:36 LBC不认输 阅读(172) 评论(0) 推荐(0) 编辑
摘要: #--hover的实现 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> body{ margin:0; } .menu{ height:50px; width:100%; background-color: #0f0f0f; color:darkgray; } . 阅读全文
posted @ 2019-09-25 20:35 LBC不认输 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 1. each 1. $.each(要遍历的对象, function(){...}) 2. $("").each(function(){ // this 是进入循环体的当前标签 console.log(this); }) 3. 退出本层循环 return 4. 退出each循环 return false 2. .data() 1. .data(key, value) --> 存值 2. .data 阅读全文
posted @ 2019-09-25 20:34 LBC不认输 阅读(892) 评论(0) 推荐(0) 编辑
摘要: http://jquery.cuishifeng.cn/ 阅读全文
posted @ 2019-09-25 20:33 LBC不认输 阅读(113) 评论(0) 推荐(0) 编辑