更改

跳到导航 跳到搜索
添加1,411字节 、​ 2021年2月5日 (五) 08:44
无编辑摘要
第7行: 第7行:  
   s.parentNode.insertBefore(hm, s);
 
   s.parentNode.insertBefore(hm, s);
 
})();
 
})();
 +
 +
//右侧目录
 +
$().ready(function(){
 +
    var b = $("<div id='rightToc' style='opacity: 0;'><div id='rtocbt'>目<br/>录</div></div>");
 +
    b.append($('#toc').children('ul').clone().removeAttr("style"));
 +
    $("#toc").after(b);
 +
    var IsAnim=false;
 +
    b.ready(function(){
 +
        $("#rightToc").children("ul").wrap("<div id='rtoculw'></div>");
 +
        $("#rtoculw").children("ul").attr('id','rtocul');
 +
    console.log($("#rtoculw").outerWidth());
 +
        $("#rightToc").css("marginRight",-$("#rtoculw").outerWidth());
 +
        $('#rtocbt').on('mouseover',function(){
 +
            if(IsAnim){
 +
                return;
 +
            }
 +
            IsAnim=true;
 +
            $("#rightToc").animate({
 +
                marginRight:'5px'
 +
            },"fast",function() {
 +
                IsAnim=false;
 +
                $('#rightToc').addClass('rtshow');
 +
                $('#rightToc').removeClass('rthide');
 +
            });
 +
        });
 +
        $($("#rtoculw")[0]).on('mouseleave',function(){
 +
            if(IsAnim){
 +
                return;
 +
            }
 +
            IsAnim=true;
 +
            $("#rightToc").animate({
 +
                marginRight:-$("#rtoculw").outerWidth()
 +
            },"fast",function(){
 +
                IsAnim=false;
 +
                $('#rightToc').addClass('rthide');
 +
                $('#rightToc').removeClass('rtshow');
 +
            });
 +
        });
 +
        $("#rightToc").css('opacity','1');
 +
    });
 +
});
    
/* 回到顶部 */
 
/* 回到顶部 */
15,684

个编辑

导航菜单