本文共 1673 字,大约阅读时间需要 5 分钟。
页首Html 代码部分增加以下代码:
更多 "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%");}
占坑,以后再补充...
转载地址:http://kvubz.baihongyu.com/