一套簡約漂亮的響應式博客園主題皮膚分享給你們(二)

来源:https://www.cnblogs.com/coding-farmer/archive/2019/11/27/11940805.html
-Advertisement-
Play Games

一、背景 前段時間,寫的一篇關於博客園主題皮膚分享的文章,一經發出便受到了極大的熱捧,後來很多網友留言說,想要讓我分享現在的模板,畢竟現在這個模板已經比之前分享的那個多經歷了N多個版本的改進和優化。那本文我就來分享我博客園中的所有的特性,以供大家直接開箱即用。廢話不多說,直接開搞~ 二、最新版CSS ...


一、背景

  前段時間,寫的一篇關於博客園主題皮膚分享的文章,一經發出便受到了極大的熱捧,後來很多網友留言說,想要讓我分享現在的模板,畢竟現在這個模板已經比之前分享的那個多經歷了N多個版本的改進和優化。那本文我就來分享我博客園中的所有的特性,以供大家直接開箱即用。廢話不多說,直接開搞~

二、最新版CSS代碼

需要copy下麵的最新版CSS代碼到頁面定製CSS代碼區中

@font-face {
  font-family: 'FontAwesome';
  font-style: normal;
  font-weight: normal;
  src: url("http://blog.zhaishidan.cn/css/font/fontawesome-webfont.eot?#iefix") format('embedded-opentype'), url("http://blog.zhaishidan.cn/css/font/fontawesome-webfont.woff") format('woff'), url("http://blog.zhaishidan.cn/css/font/fontawesome-webfont.ttf") format('truetype'), url("http://blog.zhaishidan.cn/css/font/fontawesome-webfont.svg#FontAwesomeRegular") format('svg');
}
* {
  margin: 0;
  padding: 0;
}
body {
  background: #eee;
  color: #444;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
  font-size: 14px;
  text-shadow: 0 0 1px transparent;
  color:#505050;
}
@media screen and (max-width: 1260px) {
  body {
    margin: 0px;
  }
}
@media screen and (max-width: 600px) {
  body {
    font-size: 13px;
  }
}
h1,h2,h3,h4,h5,h6 {
  font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
}
h1 {
  font-size: 1.8em;
}
h2 {
  font-size: 1.5em;
}
h3 {
  font-size: 1.3em;
}
a {
  text-decoration: none;
  color: #258fb8;
}
a:hover {
  text-decoration: underline;
}
#home{
  margin: 0 auto;
  width: 85%;
  background-color: #fff;
  padding: 30px;
  margin-top: 50px;
  margin-bottom: 50px;
  box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
  border-radius: 20px;
}
#tbCommentBody {width: 100%;}
#blogTitle {width:23%;margin-top: -10px;text-align: center;}
.alignright {float: right;}
#header, #main, #footer {width: 100%;margin: 0 auto;}
@media screen and (max-width: 1260px) {
  #main {
    width: 95%;
  }
}
#mainContent {
  width: 75%;
  float: left;
  margin-left: 10px;
}
@media screen and (max-width: 1260px) {
  #main-col {
    width: 100%;
    margin-right: -300px;
  }
}
@media screen and (max-width: 900px) {
  #main-col {
    margin-right: 0;
    float: none;
  }
}
@media screen and (max-width: 1260px) {
  #wrapper {
    margin-right: 300px;
  }
}
@media screen and (max-width: 900px) {
  #wrapper {
    margin-right: 0;
  }
}
#header {
  text-shadow: 0 0 1px #fff;
  margin: 20px auto 30px;
  position: relative;
  height: 60px;
  color: #999;
}
#header a {
  color: #999;
}
#header a:hover {
  color: #258fb8;
  text-decoration: none;
}
#header h1 {
  font-weight: normal;
  font-size: 30px;
}
#header h2 {
  font-weight: normal;
  font-size: 0.9em;
  margin-top: 10px;
  margin-left: 30px;
}
#header #navigator {
  font-family: "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  width: 100%;
  font-size: 16px;
  border-bottom: 1px solid #ededed;
  border-top: 1px solid #ededed;
  height: 50px;
  line-height: 50px;
  clear: both;
  margin-top: 25px;
}
#header #navigator ul {
  list-style: none;
}
#header #navigator ul li {
  float: left;
  width: 10%;
  text-align: center;
  margin-right: 15px;
}
#header .blogStats {
  float: right;
  font-size: 13px;
}
.topicListFooter {
  margin-top:30px;
  margin-bottom: 30px;
  margin-right: 0 !important;
}
.topicListFooter a {
  display: inline !important;
  padding: 10px 20px;
  background: #ddd;
  color: #999;
  font-family: "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  text-shadow: 0 0 1px #fff;
  border-radius: 5px;
}
.topicListFooter a:hover {
  background: #258fb8;
  color: #fff;
  text-decoration: none;
  text-shadow: none;
}
.topicListFooter .prev:before {
  content: '\f053';
  padding-right: 10px;
  font-family: FontAwesome;
}
.topicListFooter .next:after {
  content: '\f054';
  padding-left: 10px;
  font-family: FontAwesome;
}
article {
  -webkit-box-shadow: 1px 2px 3px #ddd;
  box-shadow: 1px 2px 3px #ddd;
  background: #fff;
}
article.page {
  padding-left: 20px;
}
article.page .icon {
  display: none;
}
.postIcon:before {
  content: '\f016';
}
article.photo .icon:before {
  content: '\f030';
}
article.link .icon:before {
  content: '\f0c1';
}
article.link .title a:after {
  content: '\f08e';
  color: #999;
  font: 12px FontAwesome;
  padding-left: 10px;
  vertical-align: super;
}
/******************************************以下自定義樣式***********************************************/
#MySignature{
border-top: 2px solid #ccc;
  padding-top: 20px;
}
.pager{
  border-bottom: 1px dashed #ddd;
  padding-bottom: 30px;
  margin-bottom: -10px;
}
#blog-calendar{
  width:0px;
  height:0px;
  display: none !important;
}
#TopViewPostsBlock ul li{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: inline-block;
  height: 30px;
  line-height: 30px;
}
.day .dayTitle{
      display: none !important;
}
/* 去掉廣告 */
#ad_t2,#opt_under_post,.c_ad_block,#under_post_news,#under_post_kb{
    display: none !important;
}
/******************************************以上自定義樣式***********************************************/
.postTitle, .entrylistPosttitle {
  font-family: "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 1.8em;
  padding: 20px 20px 15px 0px;
  background: #fff;
  border-radius: 10px 10px 0px 0px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entrylistPostSummary, .postCon, .postBody {
  padding: 0 20px 15px 0px;
  -webkit-box-shadow: 1px 2px 3px #ddd;
  box-shadow: 0 2px 0 #ddd;
  background: #fff;
  position: relative;
}
.postDesc, .entrylistItemPostDesc {
  padding: 0px 20px 15px 0px;
  color: #999;
  font-size: 0.9em;
  line-height: 16px;
  position: relative;
  min-height: 16px;
  background: #fff;
  border-bottom: 1px dashed #ccc;
}
/* 去掉博客園自帶日曆控制項 */
#blog-calendar {
  display: none;
}
@media screen and (max-width: 600px) {
  .postCon {
    padding-left: 0px;
  }
}
.postIcon {
  height: 0px;
  margin-right: 25px;
  position: relative;
  top: 25px;
  left: 25px;
  color: #258fb8;
}
@media screen and (max-width: 600px) {
  article header .icon {
    display: none;
  }
}
.postIcon:before {
  position: absolute;
  font: 32px FontAwesome;
  top: 0;
  left: 0;
  width: 32px;
  text-align: center;
}
article header time {
  color: #999;
  font: 0.9em "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  margin-bottom: 5px;
  display: block;
  line-height: 1;
}
article header .title {
  font-weight: normal;
}
article header .title a {
  color: #444;
}
article header .title a:hover {
  color: #258fb8;
  text-decoration: none;
}
#cnblogs_post_body {
  text-align: justify;
  line-height: 1.6;
}
#cnblogs_post_body p,
#cnblogs_post_body blockquote,
#cnblogs_post_body ul,
#cnblogs_post_body ol,
#cnblogs_post_body dl,
#cnblogs_post_body table,
#cnblogs_post_body iframe,
#cnblogs_post_body h3,
#cnblogs_post_body h4,
#cnblogs_post_body h5,
#cnblogs_post_body h6,
#cnblogs_post_body .video-container {
  margin-top: 15px;
}
#cnblogs_post_body blockquote {
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  font-style: italic;
  font-family: "Georgia", serif;
  font-size: 1.2em;
  padding: 0 30px 15px;
}
#cnblogs_post_body blockquote footer {
  border-top: none;
  font-size: 0.8em;
  line-height: 1;
  margin: 20px 0 0;
  padding-top: 0;
}
#cnblogs_post_body blockquote footer cite:before {
  content: '—';
  color: #ccc;
  padding: 0 0.5em;
}
#cnblogs_post_body code,
#cnblogs_post_body pre {
  font-family: Monaco, Menlo, Consolas, Courier New, monospace;
}
#cnblogs_post_body code {
  background: #eee;
  color: #666;
  padding: 0 5px;
  margin: 0 2px;
  font-size: 0.9em;
  border: 1px solid #ddd;
  -webkit-border-radius: 3px;
  border-radius: 3px;
}
#cnblogs_post_body pre {
  background: #eee;
  overflow: auto;
  padding: 7px 15px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
}
#cnblogs_post_body pre code {
  background: none;
  padding: 0;
  margin: 0;
  border: none;
  -webkit-border-radius: 0;
  border-radius: 0;
}
#cnblogs_post_body ul ul,
#cnblogs_post_body ol ul,
#cnblogs_post_body dl ul,
#cnblogs_post_body ul ol,
#cnblogs_post_body ol ol,
#cnblogs_post_body dl ol,
#cnblogs_post_body ul dl,
#cnblogs_post_body ol dl,
#cnblogs_post_body dl dl {
  margin-top: 0;
}
#cnblogs_post_body h1,
#cnblogs_post_body h2 {
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-top: 20px;
}
#cnblogs_post_body h3,
#cnblogs_post_body h4,
#cnblogs_post_body h5,
#cnblogs_post_body h6 {
  font-weight: normal;
  background: #eee;
  border-radius: 6px;
  color: Red;
  font-family: "微軟雅黑" , "宋體" , "黑體" ,Arial;
  min-height: 25px;
  line-height: 25px;
  margin: 18px 5px !important;
  padding: 8px;
  opacity: 0.8;
  border: 1px dashed #aaa;
}
#cnblogs_post_body h4 {
  padding-left:20px !important;
  color:Green !important;
}
.postBody img,
.entrylistPostSummary img, .postCon img,
.postBody video {
  max-width: 100%;
  height: auto;
  border: none;
}
#cnblogs_post_body iframe {
  border: none;
}
#cnblogs_post_body .caption {
  display: block;
  margin-top: 5px;
  color: #999;
  position: relative;
  font-size: 0.9em;
  padding-left: 25px;
}
#cnblogs_post_body .caption:before {
  content: '\f040';
  position: absolute;
  font: 1.3em FontAwesome;
  position: absolute;
  left: 0;
  top: 3px;
}
#cnblogs_post_body .video-container {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 30px;
  height: 0;
  overflow: hidden;
}
#cnblogs_post_body .video-container iframe,
#cnblogs_post_body .video-container object,
#cnblogs_post_body .video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin-top: 0;
}
#cnblogs_post_body .pullquote {
  float: right;
  border: none;
  padding: 0;
  margin: 1em 0 0.5em 1.5em;
  text-align: left;
  width: 45%;
  font-size: 1.5em;
}
#blog-comments-placeholder, #comment_form {
  padding: 20px;
  background: #fff;
  -webkit-box-shadow: 1px 10px 10px #ddd;
  box-shadow: 10px 10px 10px #ddd;
  margin-bottom: 50px;
  border: 1px solid #ccc;
  padding-top:0;
}
.feedback_area_title {
  margin-bottom: 15px;
  font-size: 1.8em;
}
.feedbackItem {
  border-bottom: 1px dashed #CCC;
  margin-bottom: 10px;
  padding: 5px;
}
.color_shine {
  background: rgb(226, 242, 255);
}
.feedbackItem:hover {
  -webkit-animation-name: color_shine;
  -webkit-animation-duration: 2s;
  -webkit-animation-iteration-count: infinite;
}
#comment_form .title {
  font-weight: normal;
  margin-bottom: 15px;
}
#ad_under_post_holder {
  display: none;
}
.entrylistTitle {
  color: #999;
  font-weight: normal;
  margin-bottom: 30px;
  text-shadow: 0 0 1px #fff;
}
.entrylistTitle:before {
  font-family: FontAwesome;
  content: '\f07b';
  padding-right: 15px;
}
.archive {
  -webkit-box-shadow: 1px 2px 3px #ddd;
  box-shadow: 1px 2px 3px #ddd;
  border-bottom: 1px solid #ddd;
  margin-bottom: 50px;
}
.archive article {
  -webkit-box-shadow: none;
  box-shadow: none;
}
.archive article .post-content {
  margin-bottom: 0;
}
#sideBar{
  width: 22%;
  line-height: 1.8em;
  float: right;
}
@media screen and (max-width: 900px) {
  #sideBar {
    float: none;
    width: 100%;
  }
}
.catListLink,
.catListMyTeams,
.catListComment,
.catListFeedback {
  display: none;
}
.search,
.newsItem,
.catListPostCategory,
.catListPostArchive,
.catListTag,
.catListView,
.catListBlogRank {
  background: #fff;
  -webkit-box-shadow: 1px 2px 3px #ddd;
  box-shadow: 10px 10px 10px #ddd;
  margin-bottom: 30px;
  word-wrap: break-word;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid #ddd;
}
#blog-sidecolumn h3, .newsItem h3 {
  padding: 15px 20px;
  font-size: 1em;
  border-bottom: 1px solid #ddd;
  font-weight: normal;
}
#blog-sidecolumn ul, .newsItem #blog-news {
  font-size: 0.9em;
  padding: 15px 20px;
}
#blog-sidecolumn ul,
#blog-sidecolumn ol,
#blog-sidecolumn dl {
  list-style: none;
}
#blog-sidecolumn ul ul,
#blog-sidecolumn ol ul,
#blog-sidecolumn dl ul,
#blog-sidecolumn ul ol,
#blog-sidecolumn ol ol,
#blog-sidecolumn dl ol,
#blog-sidecolumn ul dl,
#blog-sidecolumn ol dl,
#blog-sidecolumn dl dl {
  list-style: disc;
  margin-left: 20px;
}
#q {
  background: #fff;
  font-family: "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  font-style: italic;
  font-size: 1em;
  padding: 10px 15px;
  border: 1px solid #ddd;
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  color: #999;
  height: 100%;
}
#q:focus {
  color: #444;
}
/*隱藏搜索框中的無用組件*/
.mySearch {
  display: none;
}

#sideBar .tag small {
  margin-left: 15px;
  color: #999;
}
#sideBar .tag small:before {
  content: '(';
}
#sideBar .tag small:after {
  content: ')';
}
#sideBar .twitter li {
  border-bottom: 1px solid #ddd;
  padding: 15px 20px;
  font-size: 0.9em;
}
#sideBar .twitter li:last-of-type {
  border-bottom: none;
}
#sideBar .twitter small {
  display: block;
  margin-top: 10px;
  color: #999;
  line-height: 1;
}
#sideBar .tagcloud .entry {
  padding-right: 5px;
}
#sideBar .tagcloud a {
  margin-right: 10px;
  display: inline-block;
}
#footer {
  color: #999;
  margin-bottom: 50px;
  font: 0.9em/1.6 "Lato", Helvetica Neue, Helvetica, Arial, sans-serif;
  text-shadow: 0 0 1px #fff;
  text-align:center;
  margin: 30px 0px 50px;
}
.entry .gist {
  background: #eee;
  border: 1px solid #ddd;
  margin-top: 15px;
  padding: 7px 15px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  text-shadow: 0 0 1px #fff;
  line-height: 1.6;
  overflow: auto;
  color: #666;
}
.entry .gist .gist-file {
  border: none;
  font-family: inherit;
  margin: 0;
  font-size: 0.9em;
}
.entry .gist .gist-file .gist-data {
  background: none;
  border-bottom: none;
}
.entry .gist .gist-file .gist-data pre {
  padding: 0 !important;
  font-family: Monaco, Menlo, Consolas, Courier New, monospace;
}
.entry .gist .gist-file .gist-meta {
  background: none;
  color: #999;
  margin-top: 5px;
  padding: 0;
  text-shadow: 0 0 1px #fff;
  font-size: 100%;
}
.entry .gist .gist-file .gist-meta a {
  color: #258fb8;
}
.entry .gist .gist-file .gist-meta a:visited {
  color: #258fb8;
}
figure.highlight {
  background: #eee;
  border: 1px solid #ddd;
  margin-top: 15px;
  padding: 7px 15px;
  -webkit-border-radius: 2px;
  border-radius: 2px;
  text-shadow: 0 0 1px #fff;
  line-height: 1.6;
  overflow: auto;
  position: relative;
  font-size: 0.9em;
}
figure.highlight figcaption {
  color: #999;
  margin-bottom: 5px;
  text-shadow: 0 0 1px #fff;
}
figure.highlight figcaption a {
  position: absolute;
  right: 15px;
}
figure.highlight pre {
  border: none;
  padding: 0;
  margin: 0;
}
figure.highlight table {
  margin-top: 0;
  border-spacing: 0;
}
figure.highlight .gutter {
  color: #999;
  padding: 7px 10px 7px 5px !important;
  border-right: 1px solid #ddd;
  text-align: right;
}
figure.highlight .code {
  padding: 7px 7px 7px 10px !important;
  border-left: 1px solid #fff;
  color: #666;
}
pre .comment,
pre .template_comment,
pre .diff .header,
pre .doctype,
pre .pi,
pre .lisp .string,
pre .javadoc {
  color: #93a1a1;
  font-style: italic;
}
pre .keyword,
pre .winutils,
pre .method,
pre .addition,
pre .css .tag,
pre .request,
pre .status,
pre .nginx .title {
  color: #859900;
}
pre .number,
pre .command,
pre .string,
pre .tag .value,
pre .phpdoc,
pre .tex .formula,
pre .regexp,
pre .hexcolor {
  color: #2aa198;
}
pre .title,
pre .localvars,
pre .chunk,
pre .decorator,
pre .built_in,
pre .identifier,
pre .vhdl,
pre .literal,
pre .id {
  color: #268bd2;
}
pre .attribute,
pre .variable,
pre .lisp .body,
pre .smalltalk .number,
pre .constant,
pre .class .title,
pre .parent,
pre .haskell .type {
  color: #b58900;
}
pre .preprocessor,
pre .preprocessor .keyword,
pre .shebang,
pre .symbol,
pre .symbol .string,
pre .diff .change,
pre .special,
pre .attr_selector,
pre .important,
pre .subst,
pre .cdata,
pre .clojure .title {
  color: #cb4b16;
}
pre .deletion {
  color: #dc322f;
}
.feedbackManage {
  width: 160px;
  position: absolute;
  right: 0;
  text-align: right;
}
.cnblogs_code_toolbar {
  display: none;
}
#cnblogs_post_body {
  overflow: hidden;
}
#cnblogs_post_body ol {
  padding-left: 40px;
}
#cnblogs_post_body ul {
  margin-left: 35px;
}
.fixedReadRank {
  position: fixed;
  top: 20px;
  width: 270px;
}
.fixedRecRank {
  position: fixed;
  top: 360px;
  width: 270px;
}
figure.highlight {
  margin-top: 0;
  padding: 0;
}
figure table {
  width: 100%;
  margin: 0 !important;
}
#cnblogs_post_body pre {
  padding: 0;
}
#cnblogs_post_body th,
#cnblogs_post_body td {
  padding: 0;
}
.cnblogs_code pre {
  padding: 7px 15px !important;
  background: #f5f5f5;
  border: 0;
  margin-top: 0;
}
.cnblogs_code th {
  border: 1px solid silver;
  padding: 3px;
}
.cnblogs_code {
  padding: 0;
}
/*評論標題*/
.feedback_area_title {
  padding:10px;
  font-size:24px;
  font-weight:bold;
  color:#aaa;
  border-bottom:1px dashed #ccc;
}
.feedbackListSubtitle {
  font-size:12px;
  color:#888;
}
.feedbackListSubtitle a {
  color:#888;
}
.comment_quote {
  background: #eee;
  padding: 15px;
  border: 1px dashed #aaa;
  border-radius: 5px;
}
#commentform_title {
  color:#aaa;
  background-image:none;
  background-repeat:no-repeat;
  margin-bottom:10px;
  padding:10px 20px 10px 10px;
  font-size:24px;
  font-weight:bold;
  border-bottom:1px dashed #ccc;
}
/*評論框*/
#comment_form {
  margin:10px 0;
  padding:25px;
  border-radius: 10px;
  height: 343px;
  overflow: hidden;
}
.commentform {
  margin:10px 0;
  padding:10px 20px;
  background:#fff;
}
/*評論輸入域*/
#tbCommentBody {
  font-family:'MIcrosoft Yahei';
  margin-top:10px;
  background:white;
  color:#333;
  border:2px solid #fff;
  box-shadow:inset 0 0 8px #aaa;
  height:120px;
  font-size:14px;
  min-height:120px;
  border-radius: 10px;
}
/*評論條目*/
.feedbackItem {
  font-size:14px;
  line-height:24px;
  margin:10px 0;
  padding:20px;
  padding-top:5px;
}
.feedbackListSubtitle {
  font-weight:normal;
}

/*green_channel*/
#green_channel {
  text:align:right;
  padding-left:0px;
  font-weight:normal;
  font-size:13px;
  width:100%;
  border:1px dashed #ccc;
  color:#fff;
  border-radius:4px;
  margin:5px auto;
}
@media screen and (max-width: 768px) {
  body {
    font-size: 13px;
  }
  #main{
    padding:0px !important;
  }
  #mainContent{
    width: 96%;
    float: left;
    margin: 0px 2%;
  }
  #sideBar {
    display: none;
  }
  #blogTitle {
    width: 100%;
    float:none;
    margin: 20px auto 0 !important;
  }
  #header {
    height:auto !important;
    margin: 20px auto 5px;
  }
  #header #navigator {
    width: 100%;
    text-align: center;
    float:none;
  }
  #header #navigator ul {
    width: 100%;
    margin-left: 6%;
  }
  #header #navigator ul li {
    float: left;
    width: 25%;
    text-align: center;
    margin-right:0px;
  }
  .postTitle, .entrylistPosttitle {
    font-size:14px;
    padding: 20px 20px 15px 0px;
  }
  .postDesc, .entrylistItemPostDesc {	   

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • js是單線程的,為什麼可以執行非同步操作呢? 這歸結與瀏覽器(js的宿主環境)通過某種方式使得js具備了非同步的屬性。 區分進程和線程: 進程:正在運行中的應用程式。每個進程都自己獨立的記憶體空間。例如:打開的瀏覽器就是一個進程。 線程:進程的子集,是獨立的。線程在共用的記憶體空間中運行。 瀏覽器是多進程的 ...
  • 由於項目中難免會碰到需要實時刷新,無論是獲取簡訊碼,還是在支付完成後輪詢獲取當前最新支付狀態,這時就需要用到定時器。但是,定時器如果不及時合理地清除,會造成業務邏輯混亂甚至應用卡死的情況,這個時就需要清除定時器。某個頁面中啟動定時器後,一定要在頁面關閉時將定時器清除掉。即在頁面卸載(關閉)的生命周期 ...
  • 什麼是‘路由’,路由相當於一個映射,一個url地址對應一個組件,當url地址A變為url地址B,那麼對應地址A的組件就會改變為對應地址B的組件。應用於spa,即:單頁應用,url地址改變,它不會跳轉頁面,只會用url對應的模塊取代上一個url對應的模塊,始終都在一個頁面操作。取代了傳統的多頁應用。值 ...
  • 練習1:求一個數字的階乘 function getJieCheng(num) { var result = 1; for (var i = 1; i <= num; i++) { result *= i; } return result; } console.log(getJieCheng(6)); ...
  • 淺談Vue下的components模板在我們越來越深入Vue時,我們會發現我們對HTML代碼的工程量會越來越少,今天我們來談談Vue下的 components模板的 初步使用方法與 應用 我們先來簡單的寫一段components代碼(局部方法創造模板) <div id="app"> <haha></ ...
  • 1.多了兩個新方法 (1)startWith:判斷一個字元串是否以某個欄位開頭 let str='asdfgh'; console.log(str.startsWith('a'));//true 應用: let str='http://it.kaikeba.com';if(str.startsWit ...
  • <script> document.write("<s"+"cript type='text/javascript' src='../utils/getUrl.js?112"+Math.random()+"'></scr"+"ipt>"); </script> 刷新頁面,重新載入js,清除緩存拒絕3 ...
  • 功能描述: 1.滑鼠經過 左右側箭頭顯示,滑鼠離開 箭頭隱藏 2.動態添加底部小圓圈並綁定單擊事件,並且讓小圓圈的點擊事件和左右箭頭點擊事件同步 3.拷貝第一張圖片添加到ul最後可以實現動態添加圖片 4.給箭頭綁定單擊事件,並且使圖片可以無縫輪播 5.實現自動輪播(動畫函數) 具體實現代碼: 1.鼠 ...
一周排行
    -Advertisement-
    Play Games
  • 概述:在C#中,++i和i++都是自增運算符,其中++i先增加值再返回,而i++先返回值再增加。應用場景根據需求選擇,首碼適合先增後用,尾碼適合先用後增。詳細示例提供清晰的代碼演示這兩者的操作時機和實際應用。 在C#中,++i 和 i++ 都是自增運算符,但它們在操作上有細微的差異,主要體現在操作的 ...
  • 上次發佈了:Taurus.MVC 性能壓力測試(ap 壓測 和 linux 下wrk 壓測):.NET Core 版本,今天計劃準備壓測一下 .NET 版本,來測試並記錄一下 Taurus.MVC 框架在 .NET 版本的性能,以便後續持續優化改進。 為了方便對比,本文章的電腦環境和測試思路,儘量和... ...
  • .NET WebAPI作為一種構建RESTful服務的強大工具,為開發者提供了便捷的方式來定義、處理HTTP請求並返迴響應。在設計API介面時,正確地接收和解析客戶端發送的數據至關重要。.NET WebAPI提供了一系列特性,如[FromRoute]、[FromQuery]和[FromBody],用 ...
  • 原因:我之所以想做這個項目,是因為在之前查找關於C#/WPF相關資料時,我發現講解圖像濾鏡的資源非常稀缺。此外,我註意到許多現有的開源庫主要基於CPU進行圖像渲染。這種方式在處理大量圖像時,會導致CPU的渲染負擔過重。因此,我將在下文中介紹如何通過GPU渲染來有效實現圖像的各種濾鏡效果。 生成的效果 ...
  • 引言 上一章我們介紹了在xUnit單元測試中用xUnit.DependencyInject來使用依賴註入,上一章我們的Sample.Repository倉儲層有一個批量註入的介面沒有做單元測試,今天用這個示例來演示一下如何用Bogus創建模擬數據 ,和 EFCore 的種子數據生成 Bogus 的優 ...
  • 一、前言 在自己的項目中,涉及到實時心率曲線的繪製,項目上的曲線繪製,一般很難找到能直接用的第三方庫,而且有些還是定製化的功能,所以還是自己繪製比較方便。很多人一聽到自己畫就害怕,感覺很難,今天就分享一個完整的實時心率數據繪製心率曲線圖的例子;之前的博客也分享給DrawingVisual繪製曲線的方 ...
  • 如果你在自定義的 Main 方法中直接使用 App 類並啟動應用程式,但發現 App.xaml 中定義的資源沒有被正確載入,那麼問題可能在於如何正確配置 App.xaml 與你的 App 類的交互。 確保 App.xaml 文件中的 x:Class 屬性正確指向你的 App 類。這樣,當你創建 Ap ...
  • 一:背景 1. 講故事 上個月有個朋友在微信上找到我,說他們的軟體在客戶那邊隔幾天就要崩潰一次,一直都沒有找到原因,讓我幫忙看下怎麼回事,確實工控類的軟體環境複雜難搞,朋友手上有一個崩潰的dump,剛好丟給我來分析一下。 二:WinDbg分析 1. 程式為什麼會崩潰 windbg 有一個厲害之處在於 ...
  • 前言 .NET生態中有許多依賴註入容器。在大多數情況下,微軟提供的內置容器在易用性和性能方面都非常優秀。外加ASP.NET Core預設使用內置容器,使用很方便。 但是筆者在使用中一直有一個頭疼的問題:服務工廠無法提供請求的服務類型相關的信息。這在一般情況下並沒有影響,但是內置容器支持註冊開放泛型服 ...
  • 一、前言 在項目開發過程中,DataGrid是經常使用到的一個數據展示控制項,而通常表格的最後一列是作為操作列存在,比如會有編輯、刪除等功能按鈕。但WPF的原始DataGrid中,預設只支持固定左側列,這跟大家習慣性操作列放最後不符,今天就來介紹一種簡單的方式實現固定右側列。(這裡的實現方式參考的大佬 ...