设为首页 加入收藏

TOP

博客园美化鼠标滚轮下滑出现小标题方便查找(一)
2019-10-09 19:58:19 】 浏览:77
Tags:博客 美化 鼠标 滚轮 下滑 出现 标题 方便 查找

一.自己给自己定的需求

  • 鼠标滑轮移动合适位置出现小标题
  • 鼠标下滑时候出现,鼠标上滑时候消失
  • 淡出的效果

二.代码

<!--小标题-->
<style>
    .my_catalogue_div {

        line-height: 50px;
        position: fixed;
        height: 50px;
        width: 100%;
        background: url(https://images.cnblogs.com/cnblogs_com/pythonywy/1456775/o_44.png);
        background-size: 100% 100%;
        top: 0;
        z-index: 999999;
  
    }

    .my_catalogue {
        margin-right: 10px;
        float: left;
        display: block;
        position: initial;
    }

    .my_catalogue a:link, .my_catalogue a:visited, .my_catalogue a {
        display: inline-block;
        vertical-align: middle;
        font-size: 15px;
        padding: 0 10px;
        -webkit-transform: perspective(1px) translateZ(0);
        transform: perspective(1px) translateZ(0);
        box-shadow: 0 0 1px rgba(0, 0, 0, 0);
        position: relative;
        -webkit-transition-property: color;
        transition-property: color;
        -webkit-transition-duration: 0.5s;
        transition-duration: 0.5s;
        color: black;
        text-decoration: none;
    }

    .my_catalogue a:before {

        content: "";
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #222;
        transform: scaleY(0);
        transform-origin: 50% 0;
        transition-property: transform;
        transition-duration: 0.5s;
        transition-timing-function: ease-out;
    }

    .my_catalogue a:hover {
        color: white;
        box-shadow: none;
        padding: 0 10px;
    }

    .my_catalogue a:hover::before {
        transform: scaleY(1);
        transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);

    }

    @keyframes opacity_0_to_1 {
        0% {
            opacity: 0;
        }
        100% {
            opacity: 0.9;
        }

    }

    .my_catalogue_div_opacity_0_to_1 {
        animation-name: opacity_0_to_1;
        animation-duration: 2s;
        animation-fill-mode: forwards;

    }

    .home_page {
        right: 0;
        margin: 0;
        position: absolute;
    }

    .show_time {
        position: fixed;
        bottom: 0;
        height: 40px;
        background: url(https://images.cnblogs.com/cnblogs_com/pythonywy/1456775/o_44.png);
        background-size: 100% 100%;
        color: black;
        line-height: 20px;
        text-align: center;
        width: 100%;
 
    }
</style>
<body>
<div class="my_catalogue_div" style="display: none">
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/10911404.html" target="_self">算法题</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/10862019.html"
                                  target="_self">Python</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/10862096.html" target="_self">前端</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/11568799.html" target="_self">Vue</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/10862343.html" target="_self">爬虫</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/11269267.html" target="_self">数据库</a></span>
    <span class='my_catalogue'><a href="https://www.cnblogs.com/pythonywy/p/11379228.html"
                                  target="_self">Django</a></span>
    <span class='my_catalogue'><a
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇js鼠标滚轮事件上滚下滚判断 下一篇图像二值化

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目