首頁預覽的文字不會換行 - 部落格

By Sarah
at 2011-09-22T23:56
at 2011-09-22T23:56
Table of Contents
如B大說的這是要修改JS的部份
做以下步驟請先幫範本做備份...
1)範本備份
2)修改範本,找到下面這段script
function removeHtmlTag(strx,chop){
/* if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
} */
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
增加黃色的/* */ 兩個符號,將去除標籤程式碼的部份,改成文字備註
(或其實也可/*~~~*/整段刪除啦)
3)預覽,OK就存檔完工
--
做以下步驟請先幫範本做備份...
1)範本備份
2)修改範本,找到下面這段script
function removeHtmlTag(strx,chop){
/* if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
} */
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}
增加黃色的/* */ 兩個符號,將去除標籤程式碼的部份,改成文字備註
(或其實也可/*~~~*/整段刪除啦)
3)預覽,OK就存檔完工
--
Tags:
部落格
All Comments

By George
at 2011-09-26T22:38
at 2011-09-26T22:38

By Yuri
at 2011-09-28T02:51
at 2011-09-28T02:51

By Odelette
at 2011-10-02T08:42
at 2011-10-02T08:42

By Tracy
at 2011-10-06T19:43
at 2011-10-06T19:43

By Hedy
at 2011-10-09T00:59
at 2011-10-09T00:59

By Necoo
at 2011-10-10T22:06
at 2011-10-10T22:06
Related Posts
如何刪除文章下方一大片空白?

By Rachel
at 2011-09-22T20:01
at 2011-09-22T20:01
增加邊欄上下間距要改哪裡?

By Callum
at 2011-09-22T16:15
at 2011-09-22T16:15
可排序表格

By Damian
at 2011-09-22T11:59
at 2011-09-22T11:59
想詢問影音品質好、可外嵌icon的部落格

By William
at 2011-09-22T00:03
at 2011-09-22T00:03
段落空格太大 文字的行距太小 要怎麼解決OQ

By Michael
at 2011-09-19T22:35
at 2011-09-19T22:35