博客园美化博客随笔目录


博客园美化博客随笔目录

基于孤傲苍狼2014-5-11写的目录代码基础上进行改进

一.js代码



二.css代码

/*生成博客目录的CSS*/
/*自定制一个css3动画*/
@keyframes pulse {
    25% {
        transform: scale(1.05);
    }

    75% {
        transform: scale(.95);
    }
}
/*调整目录框的位置*/
#uprightsideBar {
    font-size: 10px;
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
    position: fixed;  
    top: 50px;
    right: 0px;
    width: auto;
    height: auto;
}

#sideBar {
    float: left;
    padding: 0 0 0 65px;
}

#sideBarTab {
    float: left;
    width: 40px;
    height: 200px;
    border: 1px solid #e5e5e5;
    border-right: none;
    text-align: center;
    background-image: url(https://www.cnblogs.com/images/cnblogs_com/pythonywy/1455951/o_%e7%82%ab%e5%bd%a9.png);
    color: #79a3e5;
}


/*展开后内部内容格式*/
#sideBarContents {
    float: left;
    overflow: auto;
    overflow-x: hidden;
    min-width: 0px;
    max-width: 500px;
    min-height: 200px;
    max-height: 1200px;
    border: 1px solid #e5e5e5;
    border-right: none;
    background: #fff;
    background-size: 100% 100%;
    color: #79a3e5;
}

#sideBarContents dl {
    margin: 0;
    padding: 0;
}

#sideBarContents dt {
    margin-top: 5px;
    margin-left: 5px;
}


/*CSS3hover动画*/
#sideBarContents dd:hover, dt:hover {
     animation-name: pulse;
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    box-shadow: none;
    color: #A7995A;
}

#sideBarContents dd {
    margin-left: 20px;
}

三.展示效果

未打开状态

展开效果

hover效果

三.在原先的基础上解决的bug

1.目录由于其他js导致没法加载(最主要修改的内容)

2.修改了样式

3.修改了hover样式让他看起来更加好看