曾经使用的皮肤
頁面定制CSS代碼
/*公用*/ body {font-size:15px;padding:0;margin:0;font-family:"微軟雅黑","宋體",Arial;background:#243B0D url('http://images.cnblogs.com/cnblogs_com/fresh-air/476978/o_1335233352rbUwTp.jpg') no-repeat top center fixed;min-width:1200px; }#home {opacity:1;filter: alpha(opacity=100);box-shadow:0 0 10px #1C5495;margin:20px auto;width:96%;background:#fff;overflow:auto;border:solid 1px #fff;} /*段落*/ .postBody p,.postCon p {margin:3px 0;line-height:24px; } h2 {font-size:48px;color: red;margin-bottom:3px;background:#008800;width:99%;padding:5px;text-shadow:2px 0px 11px #333030; } h3 {font-size:32px;color: white;margin-bottom:3px;background:#1D5796;width:99%;padding:5px;text-shadow:2px 0px 11px #333030; } h4 {font-size:26px;color: #0000FF;margin-bottom:3px;background:#FFF0F5;width:99%;padding:5px;text-shadow:2px 0px 11px #333030; } h5 {font-size:18px;color: #8C8239;margin-bottom:3px;background:#375623;width:99%;padding:5px;} h6 {font-size:14px;color: #00B050;margin-bottom:3px;background:#FCE4D6;width:99%;padding:5px;text-shadow:2px 0px 11px #333030; } /*超鏈接*/ a {color:#464646;text-decoration:none; }a:visited,a:hover {color:#464646; } ul {list-style:none;margin:0;padding:0; } image {border:none; } #header {padding:5px;background-color: beige; } /*博客標題*/ #blogTitle,#blogTitle a {font-weight:bold;color:#2796DE; } #blogTitle .title {margin-top:20px;height:100px;line-height:100px;font-size:55px;padding-left:120px;background:#fff url('http://images.cnblogs.com/cnblogs_com/fresh-air/476978/o_homelogo1.png') no-repeat; } .headermaintitle {} #blogTitle,#blogTitle a:hover {text-decoration:none; } /*子標題*/ .subtitle {padding-left:30px;font-size:16px;color:#1E88AB;font-weight:normal;margin:5px 0; } /*導航欄*/ #navigator {font-size:16px;height:48px;background:#144F94;text-align:center;margin-top:20px;margin-bottom:20px;margin:0 auto;z-index:100; } #navList li {margin:0;line-height:40px;display:inline-block;float:left; } #navList li:hover {background:#0A1F34; } #navList li a {padding:0 30px;text-decoration:none;line-height:48px;border:0;color:#fff;display:-moz-inline-box;display:inline-block; } .blogStats {height:48px;color:#fff;line-height:48px; } #main {padding:35px;background-color: #FBFBFF; } /*左邊*/ #sideBarMain {padding:0 10px 0 0;background:#fff;margin:0 0 20px 0;width:240px;font-size:12px;line-height:22px;}#sideBarMain a {color:#ffffff; } #leftcontentcontainer {color:#ffffff; } .newsItem {color:#ffffff; } /*公告*/ #profile_block {width: 172px;background: #1D5796;border: 1px solid #14497F;padding: 5px 15px;margin:10 0 10px; }/*主面板*/ #mainContent {margin-top:0px;padding-top:0px;padding-right:0px;background:#fff;padding-bottom:0px;float:right;width:98%;padding-left:0px;} /*每日文章列表*/ .day {background:#fff;padding:0;margin-right:-10px;margin:0 0 20px 0; } /*博客標題*/ .postTitle a {color:#144D8C; } .postTitle {padding-bottom:10px;font-size:20px;font-weight:bold;color:#464646;width:100%; background:url('http://images.cnblogs.com/cnblogs_com/AaronYang/476978/o_blog12.png') no-repeat 0 3px;padding-left:30px; } .dayTitle {display:none; }/*摘要*/ .c_b_p_desc {padding:2px;line-height:24px;color:#888; }.c_b_p_desc a {color:#086F95; } .c_b_p_desc a:hover {text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;color:#259BD2; } /*右側圖片*/ .desc_img {margin-left:10px;border:solid 1px #fff;box-shadow:0 0 10px #aaa;float:right; } /*博文頁*/ #topics .post {background:#fff; } .postCon {padding:10px 0px 0 5px;width:100%; } .postDesc {margin:0 30px;margin-bottom:2px;padding:8px 0px;font-size:12px;color:#aaa;background:#fff;text-align:right; } .postDesc a {color:#1C5495; } .postBody {padding:0; } /*google搜索框*/ #google_q,#q {height:22px;width:120px;border:solid 1px #ccc;box-shadow:inset 0 0 3px #ddd;border-radius:4px; } /*搜索按鈕*/ .btn_my_zzk {font-family:'Microsoft Yahei';border:none;height:26px;width:60px;padding:1px;font-size:14px;cursor:pointer;position:relative;vertical-align:middle;display:inline-block;background:#55895B;border-radius:4px;color:#fff; } .btn_my_zzk:hover {background:#6DA47D; } /*評論按鈕*/#btn_comment_submit {border:none;height:48px;width:910px; } /*評論按鈕*/ .comment_btn {font-family:'Microsoft Yahei';border:none;height:48px;width:120px;font-size:18px;cursor:pointer;position:relative;vertical-align:middle;display:inline-block;background:#1C5495;color:#fff; }#btn_comment_submit:hover {background:#0495FF; }/*評論標題*/ .feedback_area_title {padding:10px;font-size:24px;font-weight:bold;color:#1C5495;border-bottom:solid 6px #0495FF; } .feedbackListSubtitle {font-size:12px;color:#888; } .feedbackListSubtitle a {color:#888; } .comment_quote {background:#FCFAAC;padding:15px;border:1px solid #CCC; } #commentform_title {color:#1C5495;background-image:none;background-repeat:no-repeat;margin-bottom:10px;padding:10px 20px 10px 10px;font-size:24px;font-weight:bold;border-bottom:solid 6px #1C5495; } /*評論框*/ #comment_form {margin:10px 0;padding:0; } .commentform {margin:10px 0;padding:10px 20px;background:#fff; } /*評論輸入域*/ #tbCommentBody {font-family:'MIcrosoft Yahei';margin-top:10px;width:940px;max-width:940px;min-width:940px;background:white;color:#333;border:2px solid #fff;box-shadow:inset 0 0 8px #aaa;padding:10px;height:120px;font-size:14px;min-height:120px; } /*評論條目*/ .feedbackItem {font-size:14px;line-height:24px;margin:10px 0;padding:20px;background:#F2F2F2;box-shadow:0 0 5px #aaa; } .feedbackListSubtitle {font-weight:normal; } /*分類頁*/ .entrylist {padding:10px 20px;background:#fff; } .entrylistItem {margin:10px 0;padding:10px; } .entrylistPosttitle {font-size:18px;font-weight:bold;background:url('http://images.cnblogs.com/cnblogs_com/libaoheng/305804/o_br229512.link(en-us,MSDN.10).gif') no-repeat 0 3px;padding-left:30px; } .entrylistPostSummary {padding:10px; } .entrylistItemPostDesc {font-size:12px;color:#999;padding-left:40px; } /*尾部*/ #footer {font-size:12px;margin:20px;padding:12px;text-align:center;background:#144F94;color:#DDD;font-size:14px; } /*文章內圖片*/ #cnblogs_post_body p img {margin:5px; } #cnblogs_post_body{ padding:3px; background-color: #FBFBFF; } /*頂一下*/ .diggnum {font-size:28px;color:#428133;font-family:'Microsoft Yahei'; } #div_digg .diggnum {line-height:100px; } .diggit {float:left;width:128px;height:128px;background:url('http://images.cnblogs.com/cnblogs_com/fresh-air/476978/o_o_dig.gif') no-repeat;background-position:0 0;text-align:center;cursor:pointer; } .diggit:hover {background-position:-128px 0; } /*踩一下(園友反映,這個有點“邪惡”,呵呵,其實是我沒來得及設計這個背景圖片,就暫時把它隱藏了……可以去掉這句話)*/ .buryit {display:none; } .diggword {display:none; } /*green_channel*/ #green_channel {text-align:right;height:30px;background:#237DE5;padding-left:20px;font-weight:normal;font-size:12px;border:none;color:#fff;padding:9px;position:fixed;right:0px;bottom:0px;opacity: 0.2;filter: alpha(opacity=20); } #green_channel:hover{filter:alpha(opacity=100);opacity:1;background:#26476D;-webkit-transition:all .5s ease-out;-moz-transition:all .5s ease-out;-o-transition:all .5s ease-out;transition:all .5s ease-out; } /*最新評論*/ #myposts .PostList {font-size:14px;line-height:24px;margin:10px 0;padding:20px;background:#F2F2F2;box-shadow:0 0 5px #aaa; } #myposts .postTitl2 a {color:#132103; } ::selection {background:#FF0000;color:white; } ::-moz-selection {background:#BA6701; color:white; } ::-webkit-selection {background:#BA6701;color:white; } .catListPostCategory {width: 172px;padding: 5px 15px 5px;background: #1D5796;color: white;margin-top:4px;border: 1px solid #14497F;font-family:"微軟雅黑","宋體",Arial; }.catListPostCategory a {margin: 0 -15px;display: block;padding: 5px 10px;color: #ffffff;}.catListPostCategory a:hover {background: #EB453D;width:200px;text-decoration: none; -moz-box-shadow:2px 2px 5px #333333, 0px 0px 6px #2D3636; -webkit-box-shadow:2px 2px 5px #333333, 0px 0px 6px #2D3636; box-shadow:2px 2px 5px #333333, 0px 0px 6px #2D3636;color: #ffffff;} .boxshadow2{background-color:white;-moz-box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);-webkit-box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);box-shadow: 0 0 8px rgba(72, 106, 170, 0.5);} @-webkit-keyframes glow {0% {-webkit-box-shadow: 0 0 12px rgba(72, 106, 170, 0.5);border-color: rgba(160, 179, 214, 0.5);width:175px;}100% {-webkit-box-shadow: 0 0 12px rgba(72, 106, 170, 1.0), 0 0 18px rgba(0, 140, 255, 1.0);border-color: rgba(160, 179, 214, 1.0);width:160px;} } @-webkit-keyframes glowred {0% {-webkit-box-shadow: 0 0 12px rgba(202, 137, 137, 0.5);border-color: rgba(197, 73, 73, 0.5);}100% {-webkit-box-shadow: 0 0 16px rgba(230, 72, 51, 1.0), 0 0 38px rgba(220, 34, 4, 1.0);border-color: rgba(160, 179, 214, 1.0);} } .boxshadow3{background-color:#f0f3f9;-webkit-animation-name: glowred ;-webkit-animation-duration: 1s;-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-timing-function: ease-in-out; }.boxshadow2:hover {background-color:#f0f3f9;-webkit-animation-name: glow;-webkit-animation-duration: 1s;-webkit-animation-iteration-count: infinite;-webkit-animation-direction: alternate;-webkit-animation-timing-function: ease-in-out; } .boxshadow{ -moz-box-shadow:0px 1px 1px #333333; -webkit-box-shadow:0px 1px 1px #333333; box-shadow:0px 1px 1px #333333; }.catListBlogRank ul{ width:122px;background: #1D5796;border: 1px solid #14497F;padding: 5px 15px; margin:8 0 10px; -moz-transform:rotate(54deg) scale(1.00,1.00) translate(0px,0px) skew(0deg,0deg);-moz-transform-origin:0% 0%;-webkit-transform:rotate(54deg) scale(1.00,1.00) translate(0px,0px) skew(0deg,0deg);-webkit-transform-origin:0% 0%;-o-transform:rotate(54deg) scale(1.00,1.00) translate(0px,0px) skew(0deg,0deg);-o-transform-origin:0% 0%;transform:rotate(54deg) scale(1.00,1.00) translate(0px,0px) skew(0deg,0deg);transform-origin:0% 0% } .catListBlogRank ul li{ color:#ffffff; font-size:15px; text-shadow:2px 0px 11px #333030;} .catListBlogRank h3{ display:none; } /*---滾動條默認顯示樣式--*/ ::-webkit-scrollbar-thumb{background-color:#018EE8;height:50px;outline-offset:-2px;outline:2px solid #fff;-webkit-border-radius:2px;border: 2px solid #fff; }/*---鼠標點擊滾動條顯示樣式--*/ ::-webkit-scrollbar-thumb:hover{background-color:#6FABEC;height:50px;-webkit-border-radius:2px; }/*---滾動條大小--*/ ::-webkit-scrollbar{width:8px;height:8px; }/*---滾動框背景樣式--*/ ::-webkit-scrollbar-track-piece{background-color:#fff;-webkit-border-radius:0; } ::-webkit-scrollbar-thumb:active{height:50px;background-color:#033367;-webkit-border-radius:2px;} .headph:hover img{-webkit-transform:rotate(360deg) scale(1.5);-moz-transform:rotate(360deg) scale(1.5);-o-transform:rotate(360deg) scale(1.5);-ms-transform:rotate(360deg) scale(1.5);transform:rotate(360deg) scale(1.5); } .headph img{-webkit-transition:all 1s ease-in-out;-moz-transition:all 1s ease-in-out;-o-transition:all 1s ease-in-out;-ms-transition:all 1s ease-in-out;transition:all 1s ease-in-out;width:48px;height:48px; }#site_nav_under {display: none; } .c_ad_block, .ad_text_commentbox {display: none;margin: 0;padding: 0; } #ad_under_google {height: 0;overflow: hidden; } #ad_under_google a {display: none; } #ad_t2 {height: 0;overflow: hidden; } #ad_t2 a {display: none; } /*生成博客目錄的CSS*/ #uprightsideBar{font-size:14px;font-weight:boldfont-family:Arial, Helvetica, sans-serif;text-align:left;position:fixed;/*將div的位置固定到距離top:50px,right:0px的位置,這樣div就會處在最右邊的位置,距離頂部50px*/top:50px;right:0px;width: auto;height: auto; } #sideBarTab{float:left;width:60px;border:1px solid #e5e5e5;border-right:none;text-align:center;vertical-align:middle;background:#1D5796; }#sideBarContents{float:left;overflow:auto;overflow-x:hidden;!important;width:600px;min-height:280px;max-height:480px;border:3px solid #1D5796;border-right:none;background:#ecefbe; } #sideBarContents dl{margin:0;padding:0; }#sideBarContents dt{margin-top:5px;margin-left:5px; }#sideBarContents dd, dt {cursor: pointer; }#sideBarContents dd:hover, dt:hover {font-size:16px;color: white;margin-bottom:3px;background:#1D5796;width:99%;padding:5px;text-shadow:2px 0px 11px #333030; } #sideBarContents dd{margin-left:20px; } blockquote {background: none;border: 3px solid #1409ea;padding-left: 10px;padding-right: 10px;padding-top: 5px;padding-bottom: 5px;margin-top: 10px;margin-bottom: 10px; }#myRewards {position: fixed;_position: absolute;right: 0;top: 30%;z-index: 10000;padding-left: 34px;width: 0px;overflow: hidden;box-sizing: content-box; }博客側邊欄公告(支持HTML代碼)(支持JS代碼)
頁首Html代碼
<!---自定義返回頂部小火箭---><style> #back-top {position: fixed;bottom:70px;right: 5px;z-index: 99; } #back-top span {width: 50px;height: 64px;display: block;background:url(http://images.cnblogs.com/cnblogs_com/seanshao/855033/o_rocket.png) no-repeat center center; } #back-top a{outline:none} </style> <script type="text/javascript"> $(function() {// hide #back-top first$("#back-top").hide();// fade in #back-top$(window).scroll(function() {if ($(this).scrollTop() > 500) {$('#back-top').fadeIn();} else {$('#back-top').fadeOut();}});// scroll body to 0px on click$('#back-top a').click(function() {$('body,html').animate({scrollTop: 0}, 800);return false;}); }); </script> <p id="back-top" style="display:none"><a href="#top"><span></span></a></p><!---自定義返回頂部小火箭---><!--打賞 Start--><script>window.tctipConfig = {staticPrefix: "http://static.tctip.com",buttonImageId: 5,buttonTip: "dashang",list:{alipay: { qrimg: "http://images.cnblogs.com/cnblogs_com/ios9/807893/o_1.jpg"},weixin: { qrimg: "http://images.cnblogs.com/cnblogs_com/ios9/807893/o_2.jpg"},}}; </script><script src="http://static.tctip.com/js/tctip.min.js" /><!--打賞 End--><style type="text/css">.Abstract{padding: 15px;border: dotted 2px #999;color: #999;font-family: 'Microsoft Yahei';border-radius: 4px;}.First{margin: 10px 0;font-family: 'Microsoft Yahei';text-align: left;padding: 6px 20px;color: #fff;background: #55895B;font-size: 20px;border-radius: 4px;clear: both;}.Second{margin: 10px 0;font-family: 'Microsoft Yahei';padding: 6px 20px;background: #93C8A2;color: #fff;font-size: 18px;border-radius: 4px;clear: both;}.Third{margin: 10px 0;padding: 6px 20px;font-family: 'Microsoft Yahei';margin: 15px 0;font-size: 16px;color: fff;background: #C6EFD2;color: #999;border-radius: 4px;clear: both;}.note{margin: 10px 0;padding: 15px 20px 15px 60px;background: #FCFAA9 url('http://images.cnblogs.com/cnblogs_com/libaoheng/305804/o_yellow-pin.png') no-repeat 20px 0;font-size: 15px;font-family: 'Microsoft Yahei';box-shadow: 0 0 8px #aaa;clear: both;}.demo{text-align: left;padding: 6px 20px;overflow: auto;border-radius: 4px;background: orange;color: #fff;font-size: 16px;clear: both;}/* Image style */ #scrollUp { -moz-box-shadow:1px 1px 5px #333333; -webkit-box-shadow:1px 1px 5px #333333; box-shadow:1px 1px 5px #333333;top: 0px;right: 10px;height: 58px; /* Height of image */width: 58px; /* Width of image */background: url("http://images.cnblogs.com/cnblogs_com/fresh-air/476978/o_selectTop3.png") no-repeat;}</style><script> $(function(){ $("#header").append('<div id="cnzzDivPlace" style="width:100%;margin-top:-5px;"></div>');$("#green_channel").append('<div id="pageSign"></div>');}); </script>頁腳Html代碼
<span style="float:right;padding-right:10px;padding-top:10px;padding-bottom:10px"id="cnzzspan"></span> <script src="http://files.cnblogs.com/AaronYang/jquery.scrollUp.min.js" language="JavaScript"></script> <script> function ScrollFunction() {var sTop = $("#tbCommentBody").offset().top-189;$("html,body").animate({ scrollTop: sTop }, 500,function(){var sTop2 = $("#tbCommentBody").offset().top-189;$("html,body").animate({ scrollTop: sTop2 },10);});}$(function(){ var ite=$("#cnzzspan").remove(); $("#cnzzDivPlace").append(ite);});$(window).resize(function () {tabResize();}); var $sbm=$("#sideBarMain"); var $sbar=$("#sideBar"); function tabResize(){ var lh=$sbm.width(); var rh=$("#home").width()-lh-60; $("#mainContent").width(rh);} var heighss=1300; $(window).load(function(){tabResize(); var pinglun=$("#commentform_title"); if(pinglun.length>0){ $("#navList").append('<li style="background:#F15871" class="boxshadow3"><a id="MyLinks1_comment" class="menu" style="text-shadow:0px 0px 6px #E3D342;" href="javascript:ScrollFunction()">快速評論</a></li>'); } $("li.liRank").css({"cursor":"pointer"}); $("li.liRank").click(function(){var obj = document.getElementById("openWin");obj.href = "http://www.cnblogs.com/AllBloggers.aspx";obj.click(); });var isIE = !!window.ActiveXObject; var isIE8 = isIE && !!document.documentMode; $.scrollUp(); $("#scrollUp").text(""); $("#scrollUp").attr("title","[ISO_劉軍]ISO_劉軍\n幫你回到頂部");var firstStep=true; var SecStep=true;lastkuandu=$("#mainContent").width();var $navc=$("#navigator");//獲取要定位元素距離瀏覽器頂部的距離var navH = $navc.offset().top;//滾動條事件$(window).scroll(function(){//獲取滾動條的滑動距離var scroH = $(this).scrollTop();if(scroH>=navH){if(firstStep){firstStep=false;$navc.css({"position":"fixed","top":0,"left":"0%","width":"100%","z-index":"1000"});$navc.addClass("boxshadow");}if(!isIE8&&scroH>heighss&&SecStep&&$sbm.width()>2){SecStep=false;$sbm.css({"width":"0px"});$sbar.hide();tabResize();}if(isIE8&&scroH>heighss&&SecStep&&$sbm.width()>2){SecStep=false;$sbm.css({"width":"0px"});// $sbar.css({ opacity: 0 }); // 所有瀏覽器有效$sbar.slideUp();tabResize();}}else if(scroH<navH){if(!firstStep){firstStep=true;$navc.css({"position":"static","margin":"0 auto","width":"100%"});$navc.removeClass("boxshadow");}if(!isIE8&&scroH<heighss&&(!SecStep)&&$sbm.width()<3){SecStep=true;$sbm.css({"width":"240px"});$sbar.show();tabResize();}if(isIE8&&scroH<heighss&&(!SecStep)&&$sbm.width()<3){SecStep=true;$sbar.slideDown();$sbm.css({"width":"240px"});tabResize();}}});});</script> <script> var Enabled = true; $(window).load(function () { $("#sideBarMain").css({"margin-left":"-30px"}); $.each($(".feedbackItem"),function(i,t){var comt=$(this).find(".blog_comment_body");var commentBodyId =comt[0].id; var commentId = commentBodyId.substr(commentBodyId.lastIndexOf("_")+1); var hUrl = $("#comment_"+ commentId+"_avatar").html(); if(hUrl==null){ hUrl ='http://images.cnblogs.com/cnblogs_com/AaronYang/476978/o_11.jpg'; }$(this).find("div.feedbackListSubtitle").before('<div style="margin: 0;position:relative;border-radius:5px;width: 49px; height: 49px; border: 2px solid #dddddd;float:left;margin-right:25px;margin-top:10px;"><div class="headph"><img src="'+hUrl+'" alt="AaronYang" style="border-radius:5px;border: medium none; background: none repeat scroll 0% 0% transparent; visibility: visible; padding: 0pt; margin: 0pt; width: 48px; height: 48px; clip: rect(0px, 94px, 94px, 0px); "></div></div>');var hasl=$(this).find("span.louzhu"); if(hasl[0]){ $(this).css({"background":"#252525","color":"#fff"}); $(this).find("a[title='查看所回復的評論']").css({"color":"#fff"}); }});if (Enabled) { var isIE = !!window.ActiveXObject; var isIE6 = isIE && !window.XMLHttpRequest; var isIE8 = isIE && !!document.documentMode; var isIE7 = isIE && !isIE6 && !isIE;var broTip = $("#browserTip");if (broTip.length < 1 && (isIE6 || isIE7 || isIE8)) {$("#home").before("<div id=\"browserTip\" style=\"opacity:1;width:100%;height:30px;display:none;line-height:30px;border:1px solid #A8AAAC;text-align:center;background:#ffffff;valign:middle\">AaronYang提醒:親,你的瀏覽器不給力哦,為了獲得更好的體驗效果,建議使用<a target=\"_blank\" href=\"https://www.google.com/intl/zh-CN/chrome/browser/\" style=\"color:red;text-decoration:underline\">谷歌瀏覽器</a>或<a target=\"_blank\" style=\"color:red;text-decoration:underline\" href=\"http://firefox.com.cn/download/\">火狐瀏覽器</a>瀏覽本網站 <a href=\"javascript:CloseVersionTip()\">立即關閉</a></span></div>");$("#browserTip").slideDown();setTimeout(CloseVersionTip, 8000);} else {$("#browserTip").slideDown();setTimeout(CloseVersionTip, 8000);}} }); function CloseVersionTip() {var broTip = $("#browserTip");if (broTip) {$("#browserTip").slideUp();} }</script><script language="javascript" type="text/javascript">function GenerateContentList() {var mainContent = $('#cnblogs_post_body');var h2_list = $('#cnblogs_post_body h2');//如果你的章節標題不是h2,只需要將這里的h2換掉即可if(mainContent.length < 1)return;if(h2_list.length>0){var content = '<a name="_labelTop"></a>';content += '<div id="navCategory">';content += '<p style="font-size:18px"><b>目錄</b></p>';content += '<ul>';for(var i=0; i<h2_list.length; i++){var go_to_top = '<div style="text-align: right"><a href="#_labelTop">回到頂部</a><a name="_label' + i + '"></a></div>';$(h2_list[i]).before(go_to_top);var h3_list = $(h2_list[i]).nextAll("h3");var li3_content = '';for(var j=0; j<h3_list.length; j++){var tmp = $(h3_list[j]).prevAll('h2').first();if(!tmp.is(h2_list[i]))break;var li3_anchor = '<a name="_label' + i + '_' + j + '"></a>';$(h3_list[j]).before(li3_anchor);li3_content += '<li><a href="#_label' + i + '_' + j + '">' + $(h3_list[j]).text() + '</a></li>';}var li2_content = '';if(li3_content.length > 0)li2_content = '<li><a href="#_label' + i + '">' + $(h2_list[i]).text() + '</a><ul>' + li3_content + '</ul></li>';elseli2_content = '<li><a href="#_label' + i + '">' + $(h2_list[i]).text() + '</a></li>';content += li2_content;}content += '</ul>';content += '</div><p> </p>';content += '<p style="font-size:18px"><b>正文</b></p>';if($('#cnblogs_post_body').length != 0 ){$($('#cnblogs_post_body')[0]).prepend(content);}}var qqinfo = '<p style="color:red;font-size:26px">若需要學習技術文檔共享(請關注群公告的內容)/討論問題 請入QQ群:668345923 ;若無法入群,請在您瀏覽文章下方留言,至于答復,這個看情況了 </p>';$(mainContent[0]).prepend(qqinfo); }GenerateContentList(); </script><style type="text/css"> #scrollText {width: 400px;margin-right: auto;margin-left: auto; } </style> </head> <script type="text/javascript" src="/source/js/jquery-1.6.2.min.js"></script> <script type="text/javascript"> var ScrollTime; function ScrollAutoPlay(contID,scrolldir,showwidth,textwidth,steper){var PosInit,currPos;with($('#'+contID)){currPos = parseInt(css('margin-left'));if(scrolldir=='left'){if(currPos<0 && Math.abs(currPos)>textwidth){css('margin-left',showwidth);}else{css('margin-left',currPos-steper);}}else{if(currPos>showwidth){css('margin-left',(0-textwidth));}else{css('margin-left',currPos-steper);}}} }/* AppendToObj: 顯示位置(目標對象) ShowHeight: 顯示高度 ShowWidth: 顯示寬度 ShowText: 顯示信息 ScrollDirection: 滾動方向(值:left、right) Steper: 每次移動的間距(單位:px;數值越小,滾動越流暢,建議設置為1px) Interval: 每次執行運動的時間間隔(單位:毫秒;數值越小,運動越快) */ function ScrollText(AppendToObj,ShowHeight,ShowWidth,ShowText,ScrollDirection,Steper,Interval){var TextWidth,PosInit,PosSteper;with(AppendToObj){html('');css('overflow','hidden');css('height',ShowHeight+'px');css('line-height',ShowHeight+'px');css('width',ShowWidth);}if (ScrollDirection=='left'){PosInit = ShowWidth;PosSteper = Steper;}else{PosSteper = 0 - Steper;}if(Steper<1 || Steper>ShowWidth){Steper = 1}//每次移動間距超出限制(單位:px)if(Interval<1){Interval = 10}//每次移動的時間間隔(單位:毫秒)var Container = $('<div></div>');var ContainerID = 'ContainerTemp';var i = 0;while($('#'+ContainerID).length>0){ContainerID = ContainerID + '_' + i;i++;}with(Container){attr('id',ContainerID);css('float','left');css('cursor','default');appendTo(AppendToObj);html(ShowText);TextWidth = width();if(isNaN(PosInit)){PosInit = 0 - TextWidth;}css('margin-left',PosInit);mouseover(function(){clearInterval(ScrollTime);});mouseout(function(){ScrollTime = setInterval("ScrollAutoPlay('"+ContainerID+"','"+ScrollDirection+"',"+ShowWidth+','+TextWidth+","+PosSteper+")",Interval);});}ScrollTime = setInterval("ScrollAutoPlay('"+ContainerID+"','"+ScrollDirection+"',"+ShowWidth+','+TextWidth+","+PosSteper+")",Interval); } </script> <script type="text/javascript"> $(document).ready(function(e) {ScrollText($('#scrollText'),23,400,'歡迎光臨一品堂.技術天堂!','left',1,20);}); </script> <body> <div id="scrollText"></div> <script type="text/javascript"> if(document.getElementById('GoogleAD')!=null){document.getElementById('GoogleAD').innerHTML = '<div class="SearchEngine_AD1">' + document.getElementById('GoogleADCode').innerHTML + '</div>'; } </script><script type="text/javascript"> /*功能:生成博客目錄的JS工具測試:IE8,火狐,google測試通過孤傲蒼狼2014-5-11 */ var BlogDirectory = {/*獲取元素位置,距瀏覽器左邊界的距離(left)和距瀏覽器上邊界的距離(top)*/getElementPosition:function (ele) {var topPosition = 0;var leftPosition = 0;while (ele){topPosition += ele.offsetTop;leftPosition += ele.offsetLeft;ele = ele.offsetParent;}return {top:topPosition, left:leftPosition};},/*獲取滾動條當前位置*/getScrollBarPosition:function () {var scrollBarPosition = document.body.scrollTop || document.documentElement.scrollTop;return scrollBarPosition;},/*移動滾動條,finalPos 為目的位置,internal 為移動速度*/moveScrollBar:function(finalpos, interval) {//若不支持此方法,則退出if(!window.scrollTo) {return false;}//窗體滾動時,禁用鼠標滾輪window.onmousewheel = function(){return false;};//清除計時if (document.body.movement) {clearTimeout(document.body.movement);}var currentpos =BlogDirectory.getScrollBarPosition();//獲取滾動條當前位置var dist = 0;if (currentpos == finalpos) {//到達預定位置,則解禁鼠標滾輪,并退出window.onmousewheel = function(){return true;}return true;}if (currentpos < finalpos) {//未到達,則計算下一步所要移動的距離dist = Math.ceil((finalpos - currentpos)/10);currentpos += dist;}if (currentpos > finalpos) {dist = Math.ceil((currentpos - finalpos)/10);currentpos -= dist;}var scrTop = BlogDirectory.getScrollBarPosition();//獲取滾動條當前位置window.scrollTo(0, currentpos);//移動窗口if(BlogDirectory.getScrollBarPosition() == scrTop)//若已到底部,則解禁鼠標滾輪,并退出{window.onmousewheel = function(){return true;}return true;}//進行下一步移動var repeat = "BlogDirectory.moveScrollBar(" + finalpos + "," + interval + ")";document.body.movement = setTimeout(repeat, interval);},htmlDecode:function (text){var temp = document.createElement("div");temp.innerHTML = text;var output = temp.innerText || temp.textContent;temp = null;return output;},/*創建博客目錄,id表示包含博文正文的 div 容器的 id,mt 和 st 分別表示主標題和次級標題的標簽名稱(如 H2、H3,大寫或小寫都可以!),interval 表示移動的速度*/createBlogDirectory:function (id, mt, st, interval){//獲取博文正文div容器var elem = document.getElementById(id);if(!elem) return false;//獲取div中所有元素結點var nodes = elem.getElementsByTagName("*");//創建博客目錄的div容器var divSideBar = document.createElement('DIV');divSideBar.className = 'uprightsideBar';divSideBar.setAttribute('id', 'uprightsideBar');var divSideBarTab = document.createElement('DIV');divSideBarTab.setAttribute('id', 'sideBarTab');divSideBar.appendChild(divSideBarTab);var h2 = document.createElement('H3');divSideBarTab.appendChild(h2);var txt = document.createTextNode('目錄導航 ');h2.appendChild(txt);var divSideBarContents = document.createElement('DIV');divSideBarContents.style.display = 'none';divSideBarContents.setAttribute('id', 'sideBarContents');divSideBar.appendChild(divSideBarContents);//創建自定義列表var dlist = document.createElement("dl");divSideBarContents.appendChild(dlist);var num = 0;//統計找到的mt和stmt = mt.toUpperCase();//轉化成大寫st = st.toUpperCase();//轉化成大寫//遍歷所有元素結點for(var i=0; i<nodes.length; i++){if(nodes[i].nodeName == mt|| nodes[i].nodeName == st){//獲取標題文本var nodetext = nodes[i].innerHTML.replace(/<\/?[^>]+>/g,"");//innerHTML里面的內容可能有HTML標簽,所以用正則表達式去除HTML的標簽nodetext = nodetext.replace(/ /ig, "");//替換掉所有的 nodetext = BlogDirectory.htmlDecode(nodetext);//插入錨 nodes[i].setAttribute("id", "blogTitle" + num);var item;switch(nodes[i].nodeName){case mt: //若為主標題 item = document.createElement("dt");break;case st: //若為子標題item = document.createElement("dd");break;}//創建錨鏈接var itemtext = document.createTextNode(nodetext);item.appendChild(itemtext);item.setAttribute("name", num);item.onclick = function(){ //添加鼠標點擊觸發函數var pos = BlogDirectory.getElementPosition(document.getElementById("blogTitle" + this.getAttribute("name")));if(!BlogDirectory.moveScrollBar(pos.top, interval)) return false;};//將自定義表項加入自定義列表中dlist.appendChild(item);num++;}}if(num == 0) return false;/*鼠標進入時的事件處理*/divSideBarTab.onmouseenter = function(){divSideBarContents.style.display = 'block';}/*鼠標離開時的事件處理*/divSideBar.onmouseleave = function() {divSideBarContents.style.display = 'none';}document.body.appendChild(divSideBar);}};window.οnlοad=function(){/*頁面加載完成之后生成博客目錄*/BlogDirectory.createBlogDirectory("cnblogs_post_body","h2","h3",20); } </script>轉載于:https://www.cnblogs.com/ios9/p/9720565.html
總結
- 上一篇: Python开发-Django表单
- 下一篇: 气象卫星简介