js jq爬楼梯效果 鼠标滚动 点击回到顶部 点击左边楼层切换

这篇博客详细介绍了如何使用JavaScript结合CSS和HTML创建一个鼠标滚动时的楼梯动画效果,以及点击返回顶部和点击楼层进行页面跳转的功能。通过实例代码解析,读者可以学习到动态效果的实现技巧。
摘要由CSDN通过智能技术生成
// 引入jQuery
    <script src="../js/jquery-3.2.1.js"></script>
    <style>
        * {
   
            margin: 0;
            padding: 0;
        }

        #menu {
   
            position: fixed;
            top: 25%;
            left: 40px;
            width: 30px;
            border: 1px solid;
        }

        #menu ul li {
   
            position: relative;
            width: 30px;
            height: 30px;
            list-style: none;
            text-align: center;
            line-height: 30px;
            font-size: 12px;
            cursor: pointer;
            border-bottom: 1px dotted #AAAAAA;
        }

        #menu ul li.last {
   
            background: #ccc;
            color: black;
            border-bottom: none;
        }

        #menu ul li span {
   
            display: none;
            width: 30px;
            height: 30px;
            position: absolute;
            top: 0;
            left: 0;
            color: red;
        }

        #menu ul li:hover span {
   
            display: block;
            background: darkred;
            color: white;
        }

        #menu ul li span.active {
   
            display: block;
            background: darkred;
            color: white;
        }

        #menu ul li:hover span.active {
   
            display: block;
            background: darkred;
            color: white;
        }

        #header,
        #main,
        #footer {
   
            margin: auto;
            width: 1000px;
            text-align: center;
            font-size: 40px;
            font-weight: bold;
            line-height: 500px;
        }

        #main div {
   
            height: 700px;
            font-size: 50px;
            color: honeydew;
            line-height: 700px;
        }

        #header {
   
            height: 500px;
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值