zoukankan      html  css  js  c++  java
  • 曾经使用的皮肤

    image



    image


    页面定制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-1200px;
    }
    
    #home {
        opacity:1;
        filter: alpha(opacity=100);
        box-shadow:0 0 10px #1C5495;
        margin:20px auto;
        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;
    	99%;
    	padding:5px;
    	text-shadow:2px 0px 11px #333030;
    }
    h3 {
        font-size:32px;
        color: white;
    	margin-bottom:3px;
    	background:#1D5796;
    	99%;
    	padding:5px;
    	text-shadow:2px 0px 11px #333030;
    }
    h4 {
        font-size:26px;
        color: 	#0000FF;
    	margin-bottom:3px;
    	background:#FFF0F5;
    	99%;
    	padding:5px;
    	text-shadow:2px 0px 11px #333030;
    }
    h5 {
        font-size:18px;
        color: 	#8C8239;
    	margin-bottom:3px;
    	background:#375623;
    	99%;
    	padding:5px;
    
    }
    h6 {
        font-size:14px;
        color: 	#00B050;
    	margin-bottom:3px;
    	background:#FCE4D6;
    	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;
        240px;
        font-size:12px;
        line-height:22px;
    
    }
    
    
    #sideBarMain a {
        color:#ffffff;
    }
    #leftcontentcontainer {
        color:#ffffff;
    }
    .newsItem {
        color:#ffffff;
    }
    /*公告*/
    #profile_block {
         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;
        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;
        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-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;
        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;
        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;
        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;
        910px;
    }
    /*评论按钮*/
    .comment_btn {
        font-family:'Microsoft Yahei';
        border:none;
        height:48px;
        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;
        940px;
        max-940px;
        min-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;
        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 {
         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;
               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);
            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);
            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{
    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{
       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;
        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:bold
        font-family:Arial, Helvetica, sans-serif;
        text-align:left;
        position:fixed;/*将div的位置固定到距离top:50px,right:0px的位置,这样div就会处在最右边的位置,距离顶部50px*/
        top:50px;
        right:0px;
         auto;
        height: auto;
    }
    #sideBarTab{
        float:left;
        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;
        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;
    	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;
         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 {
          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 */
         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="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_刘军
    帮你回到顶部");
    
    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; 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;  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;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>浏览本网站 &nbsp;&nbsp;&nbsp;&nbsp;<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>';
                else
                    li2_content = '<li><a href="#_label' + i + '">' + $(h2_list[i]).text() + '</a></li>';
                content += li2_content;
            }
            content += '</ul>';
            content += '</div><p>&nbsp;</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 {
         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和st
            mt = 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.onload=function(){
        /*页面加载完成之后生成博客目录*/
        BlogDirectory.createBlogDirectory("cnblogs_post_body","h2","h3",20);
    }
    </script>
  • 相关阅读:
    SSM框架的基本配置
    Python开发的飞机打外星人小游戏
    python中count和index
    破解Xmind时长
    光流法简介
    Linux常用命令
    GitHub常用命令
    极大似然估计与最大后验概率估计
    在linux上加速git clone
    Endnote导入共享数据
  • 原文地址:https://www.cnblogs.com/ios9/p/9720565.html
Copyright © 2011-2022 走看看