Breaking News
Loading...
11 October 2011

navigation tips numbered pages on the blog

11:09 PM
1.Login to your blogger dashboard -> layout -> Edit HTML

2.Scroll to where you see ]]></ B: skin> tag.

3.Copy code below and paste it before the ]]></ b: skin> tag

ShowpageArea sebuah. {
text-decoration: underline;
}
ShowpageNum sebuah. {
border: 1px solid # cccccc;
margin: 0 3px;
padding: 3px 7px;
text-decoration: none;
}
ShowpageNum sebuah:. Hover {
background-color: # cccccc;
border: 1px solid # cccccc;
}
. ShowpagePoint {
-Moz-background-clip: perbatasan;
-Moz-background-inline-policy: kontinu;
-Moz-background-asal: padding;
background: # cccccc ulangi tidak ada gulir 0 0;
border: 1px solid # cccccc;
color: # 333333;
margin: 0 3px;
padding: 3px 7px;
text-decoration: none;
}
. ShowpageOf {
margin: 0 3px 0 0;
padding: 3px 7px;
text-decoration: none;
}
Showpage a. {
border: 1px solid # cccccc;
padding: 3px 7px;
text-decoration: none;
}
Showpage a:. Hover {
text-decoration: none;
}
ShowpageNum a: link, showpage a:.. Link {
color: # 333333;
text-decoration: none;
}



4.Now save your template.

5.Go to Layout - Page Elements> and click on "Add gadgets".

6.Select "html / java script" and add the code given below and click save.Now drag your new gadget under the section "Blog Posts".





<script type='text/javascript'>

var home_page_url = location.href;


var pageCount =
1;
var displayPageNum =
3;
var upPageWord = '
Sebelumnya';
var downPageWord = '
Berikutnya';


fungsi showpageCount (json) {
var thisUrl = home_page_url;
htmlMap var = new Array ();
var thisNum = 1;
var postNum = 1;
var itemCount = 0;
var fFlag = 0;
var eFlag = 0;
var html ='';
var upPageHtml ='';
var downPageHtml ='';





for (var i = 0, post; post = json.feed.entry [i]; i + +) {

var timestamp1 t.substring = post.published $ t.substring (0,19) + post.published $ (23,29)..;
timestamp = encodeURIComponent (timestamp1);


var title = post.title $ t.;

if (title! =''){
if (itemCount == 0 | | (itemCount% pageCount == (pageCount-1))) {
 if (thisUrl.indexOf (timestamp) =- 1) {
   thisNum = postNum;
 }

 jika (title! ='') postNum + +;
 htmlMap [htmlMap.length] = '/ search diperbarui-max =?' + timestamp + '& max-results =' + pageCount;
}
}
itemCount + +;

}

for (var p = 0; p <htmlMap.length; p + +) {
if (p> = (thisNum-displayPageNum-1) & & p <(thisNum + displayPageNum)) {
if (fFlag == 0 & & p == thisNum-2) {
 if (thisNum == 2) {
  upPageHtml = '<span class="showpage"> <a href="/">' + upPageWord + '</ a> </ span>';
 } Else {
  upPageHtml = '<span class="showpage"> <a href="'+htmlMap[p]+'">' + upPageWord + '</ a> </ span>';
 }

 fFlag + +;
}

if (p == (thisNum-1)) {
 html + = '<span class="showpagePoint">' + thisNum + '</ span>';
} Else {
 if (p == 0) {
   html + = '<span class="showpageNum"> <a href="/"> 1 </ a> </ span>';

 } Else {
  html + = '<span class="showpageNum"> <a href="'+htmlMap[p]+'">' + (p +1) + '</ a> </ span>';
 }
}

if (eFlag == 0 & & p == thisNum) {
 downPageHtml = '<span class="showpage"> <a href="'+htmlMap[p]+'">' + downPageWord + '</ a> </ span>';
 eFlag + +;
}
}
}

if (thisNum> 1) {
html =''+ upPageHtml + '' + html + '';
}

html = '<div class="showpageArea"> <span class="showpageOf"> Halaman (' + (postNum-1 )+')</ span> '+ html;

if (thisNum <(postNum-1)) {
html + = downPageHtml;
}

if (postNum == 1) postNum + +;
html + = '</ div>';


var pageArea = document.getElementsByName ("pageArea");
blogPager var = document.getElementById ("blog-pager");

if (postNum <= 2) {
html ='';
}

for (var p = 0; p <pageArea.length; p + +) {
pageArea [p] innerHTML = html;.
}

if (pageArea & & pageArea.length> 0) {
html ='';
}

if (blogPager) {
blogPager.innerHTML = html;
}


}


fungsi showpageCount2 (json) {

var thisUrl = home_page_url;
htmlMap var = new Array ();
var isLablePage = thisUrl.indexOf ("/ search label / /")!=- 1;
var thisLable = isLablePage? thisUrl.substr (thisUrl.indexOf ("/ search / label /") +14, thisUrl.length): "";
thisLable = thisLable.indexOf ("?")!=- 1? thisLable.substr (0, thisLable.indexOf ("?")): thisLable;
var thisNum = 1;
var postNum = 1;
var itemCount = 0;
var fFlag = 0;
var eFlag = 0;
var html ='';
var upPageHtml ='';
var downPageHtml ='';



var labelHtml = '<span class="showpageNum"> <a href="/search/label/'+thisLable+'?&max-results='+pageCount+'">';
var thisUrl = home_page_url;


for (var i = 0, post; post = json.feed.entry [i]; i + +) {

var timestamp1 t.substring = post.published $ t.substring (0,19) + post.published $ (23,29)..;
timestamp = encodeURIComponent (timestamp1);



var title = post.title $ t.;

if (title! =''){
if (itemCount == 0 | | (itemCount% pageCount == (pageCount-1))) {
 if (thisUrl.indexOf (timestamp) =- 1) {
  thisNum = postNum;
 }

 jika (title! ='') postNum + +;
 htmlMap [htmlMap.length] = '/ search / label /' + thisLable + + timestamp + '& max-results =' + pageCount 'diperbarui-max =? ";

}
}
itemCount + +;
}

for (var p = 0; p <htmlMap.length; p + +) {
if (p> = (thisNum-displayPageNum-1) & & p <(thisNum + displayPageNum)) {
if (fFlag == 0 & & p == thisNum-2) {
 if (thisNum == 2) {
  upPageHtml = labelHtml + upPageWord + '</ a> </ span>';
 } Else {
  upPageHtml = '<span class="showpage"> <a href="'+htmlMap[p]+'">' + upPageWord + '</ a> </ span>';
 }

 fFlag + +;
}

if (p == (thisNum-1)) {
 html + = '<span class="showpagePoint">' + thisNum + '</ span>';
} Else {
 if (p == 0) {
  html = labelHtml + '1 </ a> </ span> ';
 } Else {
  html + = '<span class="showpageNum"> <a href="'+htmlMap[p]+'">' + (p +1) + '</ a> </ span>';
 }
}

if (eFlag == 0 & & p == thisNum) {
 downPageHtml = '<span class="showpage"> <a href="'+htmlMap[p]+'">' + downPageWord + '</ a> </ span>';
 eFlag + +;
}
}
}

if (thisNum> 1) {
if (isLablePage!) {
html =''+ upPageHtml + '' + html + '';
} Else {
html =''+ upPageHtml + '' + html + '';
}
}

html = '<div class="showpageArea"> <span class="showpageOf"> Halaman (' + (postNum-1 )+')</ span> '+ html;

if (thisNum <(postNum-1)) {
html + = downPageHtml;
}

if (postNum == 1) postNum + +;
html + = '</ div>';

var pageArea = document.getElementsByName ("pageArea");
blogPager var = document.getElementById ("blog-pager");

if (postNum <= 2) {
html ='';
}

for (var p = 0; p <pageArea.length; p + +) {
pageArea [p] innerHTML = html;.
}

if (pageArea & & pageArea.length> 0) {
html ='';
}

if (blogPager) {
blogPager.innerHTML = html;
}


}


</ Script>
<script type='text/javascript'>

var thisUrl = home_page_url;
if (thisUrl.indexOf ("/ search label / /")!=- 1) {
if (thisUrl.indexOf ("update-max ")!=- 1)? {
 var lblname1 = thisUrl.substring (thisUrl.indexOf ("/ search / label /") 14, thisUrl.indexOf ("update-max?"));
} Else {
 var lblname1 = thisUrl.substring (thisUrl.indexOf ("/ search / label /") 14, thisUrl.indexOf ("& max?"));
}
}

var home_page = "/";
if (thisUrl.indexOf ("q =")==- 1)? {
if (thisUrl.indexOf ("/ search label / /")==- 1) {
 document.write ('<script src="'+home_page+'feeds/posts/summary?alt=json-in-script&callback=showpageCount&max-results=99999"> <\ / script>')
} Else {document.write ('<script src="'+home_page+'feeds/posts/full/-/'+lblname1+'?alt=json-in-script&callback=showpageCount2&max-results=99999"> <\ / script> ')
}
}
</ Script>
Note:
Changes in the values ​​pageCount, displayPageNum, upPageWord, downPageWord if you like.

You are done
Newer Post
Previous
This is the last post.

0 komentar:

Post a Comment

 
Toggle Footer