博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
博客园博客小优化
阅读量:458 次
发布时间:2019-03-06

本文共 1673 字,大约阅读时间需要 5 分钟。

博客园博客小优化

Fork me on Github

页首Html 代码部分增加以下代码:

Fork me on GitHub

更多 "Fork me on Github" 样式可以在 Github 上获取

评论头像

$(".blog_comment_body").before("
");var feedbackCon = $(".feedbackCon");for (var i = 0; i < feedbackCon.length; i++) { var span = $(feedbackCon[i]).find("span:last").eq(0).html()||"http://pic.cnitblog.com/face/sample_face.gif"; $(feedbackCon[i]).find(".author-avator img").attr("src", span); var href = $(feedbackCon[i]).parent().find(".comment_date").next().attr("href"); $(feedbackCon[i]).find(".author-avator a").attr("href", href);}

全屏阅读

这里全屏阅读的配置用了 localstorage ,这样用户设置了之后下次就会记住设置

var isFullScreenSettingKey = "isFullScreen";//toogle fullScreen$(".fullScreen").on("click",function () {    var isFullScreen = localStorage.getItem(isFullScreenSettingKey);    if(isFullScreen && isFullScreen=="1") {        //tip        $(".fullScreen").text("全屏阅读");        $(".fullScreen").attr("title","全屏阅读");        //style        $("#mainContent").css("width", "76%");        $("#sideBar").css("display", "block");        //setting        localStorage.setItem(isFullScreenSettingKey,"0");    }else{        //tip        $(this).text("取消全屏");        $(this).attr("title","取消全屏");        //style        $("#sideBar").css("display", "none");        $("#mainContent").css("width", "100%");        //setting        localStorage.setItem(isFullScreenSettingKey,"1");    }});//var isFullScreen = localStorage.getItem(isFullScreenSettingKey);if(isFullScreen && isFullScreen=="1") {    //tip    $(".fullScreen").text("取消全屏");    $(".fullScreen").attr("title","取消全屏");    //style    $("#sideBar").css("display", "none");    $("#mainContent").css("width", "100%");}

More

占坑,以后再补充...

转载地址:http://kvubz.baihongyu.com/

你可能感兴趣的文章