摘要: 1. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> /* 所有图片横向布局 10' 图片之间的间隔为16px 10' 第一张图片的左边距为0 10' 最后一张图 阅读全文
posted @ 2021-11-21 20:18 _雪 阅读(33) 评论(0) 推荐(0)
摘要: <script> //typeof instanceof var arr=[1,2,3,4,5]; // console.log(typeof arr); //object // console.log(typeof {}); //object // console.log(arr instance 阅读全文
posted @ 2021-11-18 22:13 _雪 阅读(47) 评论(0) 推荐(0)
摘要: 1.对象 <script> function Car(name,speed){ this.name=name; this.speed=speed; } Car.prototype.showName=function(){ //独立出来的公共空间,减少内存 console.log(this.name) 阅读全文
posted @ 2021-11-17 18:37 _雪 阅读(50) 评论(0) 推荐(0)
摘要: 1.登录页面悬在其他页面上 $(function(){ $("#loginPopup").click(function(){//登录按钮的点击事件 $(".pop-bg,.pop-wrapper").show(); //让遮罩层和窗口显示 $("body").css("overflow", "hid 阅读全文
posted @ 2021-11-16 23:02 _雪 阅读(56) 评论(0) 推荐(0)
摘要: 1.轮播图 <!-- 首先要把jQuery的文件链接进来 --> <script src="./js/jquery-3.3.1.min.js"></script> <!-- 链接index页面的js --> <script src="js/index.js"></script> jQuery部分:$ 阅读全文
posted @ 2021-11-15 19:52 _雪 阅读(87) 评论(0) 推荐(0)
摘要: <style> div{ width: 200px; height: 200px; background-color: rgb(65, 135, 226); } </style> 先输出一个div正方形 1.行内样式 改变display的值 隐藏 display:none 显示 display:原始 阅读全文
posted @ 2021-11-12 22:10 _雪 阅读(48) 评论(0) 推荐(0)
摘要: 先引入jQuery文件,入口函数: <script> $(function(){ }); </script> 1.内部插入 => 子节点 append(content|fn) 向每个匹配的元素内部追加内容。 append和appendTo效果一样 prepend(content) 向每个匹配的元素内 阅读全文
posted @ 2021-11-11 18:56 _雪 阅读(79) 评论(0) 推荐(1)
摘要: 1.坐标的基准 screen 屏幕 显示器左上角 page 页面 当前页面左上角 client 可视区域 显示页面的区域的左上角 offset 元素 元素的左上角 页面没有滚动时,page与client基准点重合 2.基本事件 click事件 $(".child").click(function() 阅读全文
posted @ 2021-11-10 12:16 _雪 阅读(58) 评论(0) 推荐(0)
摘要: 1.attr 和prop attr 设置或返回被选元素的属性值 attr(属性名) 获取属性 attr(属性名,属性值) 设置属性 $("span").attr("data-id","1002");//data-id="1001" console.log($("span").attr("id")); 阅读全文
posted @ 2021-11-09 15:58 _雪 阅读(61) 评论(0) 推荐(0)
摘要: 1.jQuery是什么? jQuery 是一个 JavaScript 库。 jQuery 极大地简化了 JavaScript 编程。 jQuery 是一个轻量级的"写的少,做的多"的 JavaScript 库。 2.jQuery 入口函数: 第一种$(document).ready(function 阅读全文
posted @ 2021-11-08 21:38 _雪 阅读(45) 评论(0) 推荐(0)