首页
留言反馈
网站导航
推荐
毒鸡汤
Search
1
非插件为typecho 文章生成微海报分享
19,100 阅读
2
主题移动端,样式下添加二级分类
15,544 阅读
3
主题 添加author page
14,856 阅读
4
主题添加移动端下边栏
12,856 阅读
5
EMlog添加评论者邮箱等级
9,173 阅读
typecho
dynamic
SuiYu
Emlog
xiuno
登录
/
注册
Search
标签搜索
代码
xiuno
php
css
typecho
评论
模板
say
js
修改教程
标签
珍惜
努力
recommend
善良
样式
调用
微笑
颜色
插件
Vincent
累计撰写
151
篇文章
累计收到
184
条评论
首页
栏目
typecho
dynamic
SuiYu
Emlog
xiuno
页面
留言反馈
网站导航
推荐
毒鸡汤
搜索到
147
篇与
的结果
2020-07-19
css样式大全(整理版)
字体属性:(font)大小 {font-size: x-large;}(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD样式 {font-style: oblique;}(偏斜体) italic;(斜体) normal;(正常)行高 {line-height: normal;}(正常) 单位:PX、PD、EM粗细 {font-weight: bold;}(粗体) lighter;(细体) normal;(正常)变体 {font-variant: small-caps;}(小型大写字母) normal;(正常)大小写 {text-transform: capitalize;}(首字母大写) uppercase;(大写) lowercase;(小写) none;(无)修饰 {text-decoration: underline;}(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁)常用字体: (font-family)"Courier New", Courier, monospace, "Times New Roman", Times, serif, Arial, Helvetica, sans-serif, Verdana背景属性: (background)色彩 {background-color: #FFFFFF;}图片 {background-image: url();}重复 {background-repeat: no-repeat;}滚动 {background-attachment: fixed;}(固定) scroll;(滚动)位置 {background-position: left;}(水平) top(垂直);简写方法 {background:#000 url(..) repeat fixed left top;} /简写·这个在阅读代码中经常出现,要认真的研究/区块属性: (Block) /这个属性第一次认识,要多多研究/字间距 {letter-spacing: normal;} 数值 /这个属性似乎有用,多实践下/对齐 {text-align: justify;}(两端对齐) left;(左对齐) right;(右对齐) center;(居中)缩进 {text-indent: 数值px;}垂直对齐 {vertical-align: baseline;}(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom;词间距word-spacing: normal; 数值空格white-space: pre;(保留) nowrap;(不换行)显示 {display:block;}(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table; table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题) /display 属性的了解很模糊/方框属性: (Box)width:; height:; float:; clear:both; margin:; padding:; 顺序:上右下左边框属性: (Border)border-style: dotted;(点线) dashed;(虚线) solid; double;(双线) groove;(槽线) ridge;(脊状) inset;(凹陷) outset;border-width:; 边框宽度border-color:#;简写方法border:width style color; /简写/列表属性: (List-style)类型list-style-type: disc;(圆点) circle;(圆圈) square;(方块) decimal;(数字) lower-roman;(小罗码数字) upper-roman; lower-alpha; upper-alpha;位置list-style-position: outside;(外) inside;图像list-style-image: url(..);定位属性: (Position)Position: absolute; relative; static;visibility: inherit; visible; hidden;overflow: visible; hidden; scroll; auto;clip: rect(12px,auto,12px,auto) (裁切)css属性代码大全一 CSS文字属性:color : #999999; /文字颜色/font-family : 宋体,sans-serif; /文字字体/font-size : 9pt; /文字大小/font-style:itelic; /文字斜体/font-variant:small-caps; /小字体/letter-spacing : 1pt; /字间距离/line-height : 200%; /设置行高/font-weight:bold; /文字粗体/vertical-align:sub; /下标字/vertical-align:super; /上标字/text-decoration:line-through; /加删除线/text-decoration: overline; /加顶线/text-decoration:underline; /加下划线/text-decoration:none; /删除链接下划线/text-transform : capitalize; /首字大写/text-transform : uppercase; /英文大写/text-transform : lowercase; /英文小写/text-align:right; /文字右对齐/text-align:left; /文字左对齐/text-align:center; /文字居中对齐/text-align:justify; /文字分散对齐/vertical-align属性vertical-align:top; /垂直向上对齐/vertical-align:bottom; /垂直向下对齐/vertical-align:middle; /垂直居中对齐/vertical-align:text-top; /文字垂直向上对齐/vertical-align:text-bottom; /文字垂直向下对齐/二、CSS边框空白padding-top:10px; /上边框留空白/padding-right:10px; /右边框留空白/padding-bottom:10px; /下边框留空白/padding-left:10px; /*左边框留空白三、CSS符号属性:list-style-type:none; /不编号/list-style-type:decimal; /阿拉伯数字/list-style-type:lower-roman; /小写罗马数字/list-style-type:upper-roman; /大写罗马数字/list-style-type:lower-alpha; /小写英文字母/list-style-type:upper-alpha; /大写英文字母/list-style-type:disc; /实心圆形符号/list-style-type:circle; /空心圆形符号/list-style-type:square; /实心方形符号/list-style-image:url(/dot.gif); /图片式符号/list-style-position: outside; /凸排/list-style-position:inside; /缩进/四、CSS背景样式:background-color:#F5E2EC; /背景颜色/background:transparent; /透视背景/background-image : url(/image/bg.gif); /背景图片/background-attachment : fixed; /浮水印固定背景/background-repeat : repeat; /重复排列-网页默认/background-repeat : no-repeat; /不重复排列/background-repeat : repeat-x; /在x轴重复排列/background-repeat : repeat-y; /在y轴重复排列/指定背景位置background-position : 90% 90%; /背景图片x与y轴的位置/background-position : top; /向上对齐/background-position : buttom; /向下对齐/background-position : left; /向左对齐/background-position : right; /向右对齐/background-position : center; /居中对齐/五、CSS连接属性:a /所有超链接/a:link /超链接文字格式/a:visited /浏览过的链接文字格式/a:active /按下链接的格式/a:hover /鼠标转到链接/鼠标光标样式:链接手指 CURSOR: hand十字体 cursor:crosshair箭头朝下 cursor:s-resize十字箭头 cursor:move箭头朝右 cursor:move加一问号 cursor:help箭头朝左 cursor:w-resize箭头朝上 cursor:n-resize箭头朝右上 cursor:ne-resize箭头朝左上 cursor:nw-resize文字I型 cursor:text箭头斜右下 cursor:se-resize箭头斜左下 cursor:sw-resize漏斗 cursor:wait光标图案(IE6) p {cursor:url("光标文件名.cur"),text;}六、CSS框线一览表:border-top : 1px solid #6699cc; /上框线/border-bottom : 1px solid #6699cc; /下框线/border-left : 1px solid #6699cc; /左框线/border-right : 1px solid #6699cc; /右框线/以上是建议书写方式,但也可以使用常规的方式 如下:border-top-color : #369 /设置上框线top颜色/border-top-width :1px /设置上框线top宽度/border-top-style : solid/设置上框线top样式/其他框线样式solid /实线框/dotted /虚线框/double /双线框/groove /立体内凸框/ridge /立体浮雕框/inset /凹框/outset /凸框/七、CSS表单运用:文字方块按钮复选框选择钮多行文字方块下拉式菜单 选项1选项2八、CSS边界样式:margin-top:10px; /上边界/margin-right:10px; /右边界值/margin-bottom:10px; /下边界值/margin-left:10px; /左边界值/CSS 属性: 字体样式(Font Style)序号 中文说明 标记语法1 字体样式 {font:font-style font-variant font-weight font-size font-family}2 字体类型 {font-family:"字体1","字体2","字体3",...}3 字体大小 {font-size:数值|inherit| medium| large| larger| x-large| xx-large| small| smaller| x-small| xx-small}4 字体风格 {font-style:inherit|italic|normal|oblique}5 字体粗细 {font-weight:100-900|bold|bolder|lighter|normal;}6 字体颜色 {color:数值;}7 阴影颜色 {text-shadow:16位色值}8 字体行高 {line-height:数值|inherit|normal;}9 字 间 距 {letter-spacing:数值|inherit|normal}10 单词间距 {word-spacing:数值|inherit|normal}11 字体变形 {font-variant:inherit|normal|small-cps }12 英文转换 {text-transform:inherit|none|capitalize|uppercase|lowercase}13 字体变形 {font-size-adjust:inherit|none}14 字体 {font-stretch:condensed|expanded|extra-condensed|extra-expanded|inherit|narrower|normal| semi-condensed|semi-expanded|ultra-condensed|ultra-expanded|wider}文本样式(Text Style)序号 中文说明 标记语法1 行 间 距 {line-height:数值|inherit|normal;}2 文本修饰 {text-decoration:inherit|none|underline|overline|line-through|blink}3 段首空格 {text-indent:数值|inherit}4 水平对齐 {text-align:left|right|center|justify}5 垂直对齐 {vertical-align:inherit|top|bottom|text-top|text-bottom|baseline|middle|sub|super}6 书写方式 {writing-mode:lr-tb|tb-rl}背景样式序号 中文说明 标记语法1 背景颜色 {background-color:数值}2 背景图片 {background-image: url(URL)|none}3 背景重复 {background-repeat:inherit|no-repeat|repeat|repeat-x|repeat-y}4 背景固定 {background-attachment:fixed|scroll}5 背景定位 {background-position:数值|top|bottom|left|right|center}6 背影样式 {background:背景颜色|背景图象|背景重复|背景附件|背景位置}框架样式(Box Style)序号 中文说明 标记语法1 边界留白 {margin:margin-top margin-right margin-bottom margin-left}2 补 白 {padding:padding-top padding-right padding-bottom padding-left}3 边框宽度 {border-width:border-top-width border-right-width border-bottom-width border-left-width} 宽度值: thin|medium|thick|数值4 边框颜色 {border-color:数值 数值 数值 数值} 数值:分别代表top、right、bottom、left颜色值5 边框风格 {border-style:none|hidden|inherit|dashed|solid|double|inset|outset|ridge|groove}6 边 框 {border:border-width border-style color}上 边 框 {border-top:border-top-width border-style color}右 边 框 {border-right:border-right-width border-style color}下 边 框 {border-bottom:border-bottom-width border-style color}左 边 框 {border-left:border-left-width border-style color}7 宽 度 {width:长度|百分比| auto}8 高 度 {height:数值|auto}9 漂 浮 {float:left|right|none}10 清 除 {clear:none|left|right|both}分类列表序号 中文说明 标记语法1 控制显示 {display:none|block|inline|list-item}2 控制空白 {white-space:normal|pre|nowarp}3 符号列表 {list-style-type:disc|circle|square|decimal|lower-roman|upper-roman|lower-alpha|upper-alpha|none}4 图形列表 {list-style-image:URL}5 位置列表 {list-style-position:inside|outside}6 目录列表 {list-style:目录样式类型|目录样式位置|url}7 鼠标形状 {cursor:hand|crosshair|text|wait|move|help|e-resize|nw-resize|w-resize|s-resize|se-resize|sw-resize}
2020年07月19日
1,423 阅读
0 评论
4 点赞
2020-07-18
2020/07/18
成熟不是人的心变老,是泪在打转还能微笑。
2020年07月18日
2,146 阅读
1 评论
1 点赞
2020-07-17
在Typecho文章底部添加打赏功能的实现
添加CSS样式#QR { padding-top:20px; } #QR a { border:0 } #QR img { width:100px; max-width:100%; display:inline-block; margin:.8em 2em 0 2em } #rewardButton { border:1px solid #ccc; line-height:36px; text-align:center; height:36px; display:block; border-radius:4px; -webkit-transition-duration:.4s; transition-duration:.4s; background-color:#fff; color:#999; margin:0 auto; padding:0 25px } #rewardButton:hover { color:#f77b83; border-color:#f77b83; outline-style:none }找到当前主题下的 post.php 在适当的位置添加代码<div style="padding: 10px 0; margin: 20px auto; width: 100%; font-size:16px; text-align: center;"> <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}"> <span>打赏</span></button> <div id="QR" style="display: none;"> <div id="wechat" style="display: inline-block"> <a class="fancybox" rel="group"> <img id="wechat_qr" src="http://2025ly.cn/usr/themes/maupassant-master/img/wx.png" alt="WeChat Pay"></a> <p>微信打赏</p> </div> <div id="alipay" style="display: inline-block"> <a class="fancybox" rel="group"> <img id="alipay_qr" src="http://2025ly.cn/usr/themes/maupassant-master/img/zfb.png" alt="Alipay"></a> <p>支付宝打赏</p> </div> </div> </div>
2020年07月17日
1,727 阅读
0 评论
6 点赞
2020-07-16
人生六个字
第一个字:生一切痛苦与欢乐,皆源于生。生,开启了人生的酸甜苦辣。是生命,给了我们追求的机会与纠葛。第二个字:苦苦,才是人生。生活从来没有一帆风顺。技能,需要你苦苦摸索才能获取;梦想,需要你苦苦追求才能实现;幸福,需要你苦心经营才能拥有。第三个字:累随着年龄的增长,扮演的角色越来越多,肩上的担子越来越重,人生之路变得越发艰难。努力却没有结果的心累,真心对待却换来虚伪的心累,这都是人生常态。第四个字:情亲情、友情、爱情,是必须珍惜的财富。活着,不求大富大贵,但求父母身体健康。不求朋友成群,但求有三两知己。不求桃花运旺盛,但求一人真心。第五个字:拼命运是公平的,很多东西,都要靠努力争取。人生最大的魅力,在于你永远拥有翻身的机会。跌倒了再爬起来,活着,要有越挫越勇的勇气。第六个字:惜有些人,见一面就是最后一面。珍惜身边人,珍惜当下事。不做无畏的等待,不做无畏的追逐。怀揣一份美好愿望,带着一颗热忱勇敢前行。
2020年07月16日
1,566 阅读
0 评论
2 点赞
2020-07-14
typecho创建归档页面
创建模版复制一份使用的模版中的page.php,文件名改成你自定义模版的名字。修改模板将复制出的page.php文件内第一行
2020年07月14日
1,899 阅读
0 评论
6 点赞
2020-07-14
通过prism.js实现Typecho代码语法高亮
实现方法 进入prism.js官网的下载页面,Compression level一般选Minified version;Themes根据自己喜好选择;Languages选要用的就好了;全选的话js文件有320KB+,比较大;Plugins按需选择,全选的多个50KB左右。都选好了就可以下载js和css文件了。可以将下载好的js和css文件上传到Typecho的主题目录,即“usr/themes/主题名”目录下,然后登陆进入Typecho的后台,“控制台" --> “外观” --> "编辑当前外观",编辑header.php文件,在标签内插入如下代码:<link rel="stylesheet" href="<?php $this->options->themeUrl('prism.css');?>" /> <script src="<?php $this->options->themeUrl('prism.js');?>"></script>保存文件即可生效。在使用Markdown写文章时,只要在代码块标记`标记后面添加你的代码的语言名,如php、html、python等,就可以实现代码高亮展示。
2020年07月14日
1,628 阅读
0 评论
2 点赞
2020-07-13
Typecho在百度BCH的Rewrite规则
用文本工具创建一个“bcloud_nginx_user.conf”文件,最好使用UTF-8编码Typecho中输入:if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; }保存后用FTP将“bcloud_nginx_user.conf”文件上传到根目录,即“webroot”文件夹。在百度云虚拟主机控制面板重新加载服务服务加载完成后,伪静态规则就生效了,访问伪静态后的网页就正常了。
2020年07月13日
1,556 阅读
0 评论
2 点赞
2020-07-13
加载时间
在 functions.php 中加入以下代码: /** * 加载时间 * @return bool */ function timer_start() { global $timestart; $mtime = explode( ' ', microtime() ); $timestart = $mtime[1] + $mtime[0]; return true; } timer_start(); function timer_stop( $display = 0, $precision = 3 ) { global $timestart, $timeend; $mtime = explode( ' ', microtime() ); $timeend = $mtime[1] + $mtime[0]; $timetotal = number_format( $timeend - $timestart, $precision ); $r = $timetotal < 1 ? $timetotal * 1000 . " ms" : $timetotal . " s"; if ( $display ) { echo $r; } return $r; }然后,在模板中引用:<?php echo timer_stop();?>前台输出相关统计1.<?php Typecho_Widget::widget('Widget_Stat')->to($stat); ?> 2.<p><?php _e('氪星人自 <strong>2013</strong> 年建站以来,截至 %s 在设定的 <strong>%s</strong> 个分类 3.和 <strong>%s</strong> 个页面中, 4.发布了 <strong>%s</strong> 篇文章,收到了 <strong>%s</strong> 条评论。 5.', date('Y年n月j日G时i分'), $stat->categoriesNum, $stat->publishedPagesNum, $stat->publishedPostsNum, $stat->publishedCommentsNum); ?></p>文章字数统计在主题的functions.php中写入代码: function art_count ($cid){ $db=Typecho_Db::get (); $rs=$db->fetchRow ($db->select ('table.contents.text')->from ('table.contents')->where ('table.contents.cid=?',$cid)->order ('table.contents.cid',Typecho_Db::SORT_ASC)->limit (1)); echo mb_strlen($rs['text'], 'UTF-8'); } 然后在想要添加的地方之间加调用就ok <?php echo art_count($this->cid); ?>总访客数统计代码 functions.php 中,添加以下统计代码//总访问量 function theAllViews() { $db = Typecho_Db::get(); $row = $db->fetchAll('SELECT SUM(VIEWS) FROM `typecho_contents`'); echo number_format($row[0]['SUM(VIEWS)']); } 然后在你需要显示的位置(如:footer.php sidebar.php 等)插入以下调用代码 <?php echo theAllViews();?></span><?php _me("访客总数") ?>添加版权声明<blockquote> <strong>本文作者:</strong><a target="_blank" href="https://www.2025ly.com">ly's Blog</a> <br><br> <strong>本文链接:</strong><a target="_blank" href="<?php $this->permalink() ?>"><?php $this->title() ?> - <?php $this->permalink() ?></a> <br><br> <strong>版权声明:</strong>如无特别声明,本文即为原创文章,仅代表个人观点,版权归 <a href="<?php $this->options->siteUrl(); ?>" target="_blank"><?$this->options->title();?></a> 所有,未经允许不得转载! </blockquote>
2020年07月13日
3,375 阅读
2 评论
2 点赞
2020-07-13
typecho模板常用代码
站点动态标题<?php $this->archiveTitle(array( 'category'=>_t('分类 %s 下的文章'), 'search'=>_t('包含关键字 %s 的文章'), 'tag' =>_t('标签 %s 下的文章'), 'author'=>_t('%s 的主页') ), '', ' - '); ?>站点地址,名称与描述<?php $this->options->siteUrl(); ?>//站点地址 <?php $this->options->title(); ?>//名称 <?php $this->options->description() ?>//描述index.php文章循环输出<?php if ($this->have()): ?>//判断文章存在与否 <?php while($this->next()): ?>//开始循环 <a href="<?php $this->permalink() ?>"><?php $this->title() ?></a>//文章标题和超链接 <a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>//作者名称和超链接 <?php $this->date('F j, Y'); ?>//文章发布时间 <?php $this->category(','); ?>//文章分类 <?php $this->commentsNum('%d Comments'); ?>//评论数量 <?php $this->content('Continue Reading...'); ?>//阅读全文more语法截取缩略内容(可改为<?php $this->excerpt(140,'....'); ?>自动截取前140个字符,根据需要也可以改成 <?php $this->summary(); ?新版功能,自动输出内容中第一个块级元素中的内容>) <?php endwhile; ?>//循环结束 <?php else: ?>暂无与之相关文章<?php endif; ?>//判断结束翻页代码<?php $this->pageNav('上一页', '下一页', '5', '……'); ?>//显示多个页码的 <?php $this->pageLink('下一页','next'); ?> <?php $this->pageLink('上一页'); ?>//只显示上一页下一页页码显示当前页码:<?php if($this->_currentPage>1) echo $this->_currentPage; else echo 1;?> 总页码:<?php echo ceil($this->getTotal() / $this->parameter->pageSize); ?>文章全文显示<?php $this->content(); ?>登陆判断 <?php if($this->user->hasLogin()):?> 登陆才可以看到这里的内容 <?php endif;?>文章作者名称与主页地址<a href="<?php $this->author->permalink(); ?>"><?php $this->author(); ?></a>文章最后编辑时间<?php echo gmdate('Y-m-d H:i', $this->modified + Typecho_Widget::widget('Widget_Options')->timezone); ?>当前文章id<?php $this->cid(); ?>文章中的上一篇和下一篇<?php $this->title(); ?> //标题 <?php $this->category(','); ?> //分类 <?php $this->tags(', ', true, ''); ?> //标签 <?php $this->date('F jS, Y') ?> //时间 <?php $this->content(); ?> //内容 上一篇: <?php $this->thePrev('%s','没有了'); ?> 下一篇: <?php $this->theNext('%s','没有了'); ?>文章标签<?php $this->tags(', ', true, 'none'); ?> 说明:(', ', true, 'none')第一个单引号间的逗号代表标签与标签的间隔用逗号隔开,true是标签以超链接形式输出,none为该文章没有标签时显示的提示信息用户昵称<?php $this->user->screenName(); ?>后台地址与登陆地址<?php $this->options->adminUrl(); ?>//后台地址 <?php $this->options->adminUrl('login.php'); ?>//登陆地址文章rss和评论rss<a href="<?php $this->options->feedUrl(); ?>"><?php _e('文章 RSS'); ?></a> <a href="<?php $this->options->commentsFeedUrl(); ?>"><?php _e('评论 RSS'); ?></a>搜索代码<form method="post"> <p><input type="text" name="s" class="text" autofocus /></p> <p><button type="submit" class="submit"><?php _e('搜索'); ?></button></p></form>分类描述<?php echo $this->getDescription(); ?>随机标签云<?php $this->widget('Widget_Metas_Tag_Cloud', 'ignoreZeroCount=1&limit=30')->to($tags); ?> <ul class="tags-list"> <?php while($tags->next()): ?> <li><a style="color: rgb(<?php echo(rand(0, 255)); ?>, <?php echo(rand(0,255)); ?>, <?php echo(rand(0, 255)); ?>)" href="<?php $tags->permalink(); ?>" title='<?php $tags->name(); ?>'><?php $tags->name(); ?></a></li> <?php endwhile; ?> </ul>标签相关文章<?php $this->related(5)->to($relatedPosts); ?> <ul> <?php while ($relatedPosts->next()): ?> <li><a href="<?php $relatedPosts->permalink(); ?>" title="<?php $relatedPosts->title(); ?>"><?php $relatedPosts->title(); ?></a></li> <?php endwhile; ?> </ul>调用某分类文章,pageSize是数量,mid是分类号:<?php $this->widget('Widget_Archive@index', 'pageSize=6&type=category', 'mid=47′) ->parse('<li><a href="{permalink}">{title}</a></li>'); ?>首行缩进问题,加入css实现.post-content p{ text-indent: 2em; /*em是相对单位,2em即现在一个字大小的两倍*/ } 全部标签列表,按照MID排序<?php $this->widget('Widget_Metas_Tag_Cloud') ->to($taglist); ?><?php while($taglist->next()): ?>//循环输出 <a href="<?php $taglist->permalink(); ?>" title="<?php $taglist->name(); ?>"><?php $taglist->name(); ?></a> <?php endwhile; ?>//循环结束最新文章<?php $this->widget('Widget_Contents_Post_Recent')->to($post); ?> <?php while($post->next()): ?> <a href=”<?php $post->permalink(); ?>” title=”<?php $post->title(); ?>”> <?php $post->title(25, '…'); ?></a> <?php endwhile; ?>判断为当前页的第几篇文章,并单独输出内容<?php if ($this->sequence == 0): ?> //需要的插入 <?php endif; ?>神奇的is语法<?php if ($this->is('post')) : ?> 这里就是内容了 <?php endif; ?> typecho可以使用is语法判断很多东西,比如 $this->is('index'); $this->is('archive'); $this->is('single'); $this->is('page'); $this->is('post'); $this->is('category'); $this->is('tag'); 甚至是 $this->is('category', 'default'); $this->is('page', 'start'); $this->is('post', 1);Typecho 建站首页实现阅读全文Typecho自动显示摘要,200为自动摘要的字数。 1.<p><?php $this->excerpt(200); ?></p> 2.<p class="more"><a href="<?php $this->permalink() ?>" rel="bookmark" title="<?php $this->title() ?>">阅读全文</a></p>给网站添加返回顶部按钮<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript">var scrolltotop={setting:{startline:100,scrollto:0,scrollduration:1e3,fadeduration:[500,100]},controlHTML:'<img src="https://i1155.photobucket.com/albums/p559/scrolltotop/arrow5.png" />',controlattrs:{offsetx:5,offsety:5},anchorkeyword:"#top",state:{isvisible:!1,shouldvisible:!1},scrollup:function(){this.cssfixedsupport||this.$control.css({opacity:0});var t=isNaN(this.setting.scrollto)?this.setting.scrollto:parseInt(this.setting.scrollto);t="string"==typeof t&&1==jQuery("#"+t).length?jQuery("#"+t).offset().top:0,this.$body.animate({scrollTop:t},this.setting.scrollduration)},keepfixed:function(){var t=jQuery(window),o=t.scrollLeft()+t.width()-this.$control.width()-this.controlattrs.offsetx,s=t.scrollTop()+t.height()-this.$control.height()-this.controlattrs.offsety;this.$control.css({left:o+"px",top:s+"px"})},togglecontrol:function(){var t=jQuery(window).scrollTop();this.cssfixedsupport||this.keepfixed(),this.state.shouldvisible=t>=this.setting.startline?!0:!1,this.state.shouldvisible&&!this.state.isvisible?(this.$control.stop().animate({opacity:1},this.setting.fadeduration[0]),this.state.isvisible=!0):0==this.state.shouldvisible&&this.state.isvisible&&(this.$control.stop().animate({opacity:0},this.setting.fadeduration[1]),this.state.isvisible=!1)},init:function(){jQuery(document).ready(function(t){var o=scrolltotop,s=document.all;o.cssfixedsupport=!s||s&&"CSS1Compat"==document.compatMode&&window.XMLHttpRequest,o.$body=t(window.opera?"CSS1Compat"==document.compatMode?"html":"body":"html,body"),o.$control=t('<div id="topcontrol">'+o.controlHTML+"</div>").css({position:o.cssfixedsupport?"fixed":"absolute",bottom:o.controlattrs.offsety,right:o.controlattrs.offsetx,opacity:0,cursor:"pointer"}).attr({title:"Scroll to Top"}).click(function(){return o.scrollup(),!1}).appendTo("body"),document.all&&!window.XMLHttpRequest&&""!=o.$control.text()&&o.$control.css({width:o.$control.width()}),o.togglecontrol(),t('a[href="'+o.anchorkeyword+'"]').click(function(){return o.scrollup(),!1}),t(window).bind("scroll resize",function(t){o.togglecontrol()})})}};scrolltotop.init(); </script> <noscript>Not seeing a <a href="https://www.scrolltotop.com/">Scroll to Top Button</a>? Go to our FAQ page for more info.</noscript>
2020年07月13日
2,007 阅读
0 评论
4 点赞
1
...
15
16
17