JQurey概述




下载:http://jqurey.com/

JQurey的基本使用

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="jquery.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
div {
width: 200px;
height: 200px;
margin: 140px auto;
background-color: skyblue;
}
</style>
</head>
<body>
<script>
// 1.等着JS代码加载完在执行JS代码
// $(document).ready(function() {
// $('div').hide();
// })
// 2.更简单
$(function() {
$('div').hide();
})
</script>
<div></div>
</body>
</html>
JQurey的筛选选择器



$(this).index()获取当前元素索引号





本文介绍JQuery的基础使用方法,包括如何加载JQuery库并利用它来隐藏页面中的元素。此外,还介绍了如何通过$(this).index()获取元素的索引号。
222

被折叠的 条评论
为什么被折叠?



