<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js/jquery-3.4.1.min.js"></script>
<script>
$(function(){
$('.daohang li').eq(0).click(function(){
$('html, body').animate({
scrollTop: $("#div1").offset().top
}, 200);
});
$('.daohang li').eq(1).click(function(){
$('html, body').animate({
scrollTop: $("#div2").offset().top
}, 200);
});
$('.daohang li').eq(2).click(function(){
$('html, body').animate({
scrollTop: $("#div3").offset().top
}, 200);
});
$('.daohang li').eq(3).click(function(){
$
jQuery滚动监听导航栏(导航栏点击跳转对应界面并且变色)
最新推荐文章于 2023-08-14 15:49:03 发布