2016-03-19 28 views
1

Blogger'ım için blogger özel şablonu kullanıyorum ancak çağrı cihazı kodum burada çalışmıyor. Lütfen problemi çözmek için yardımcı olun. İnternette birçok kod denedim ancak sayfa numarası bir sonraki sayfaya bağlanmadı.Blogger pagger kodu çalışmıyor

<div class="pagenav"> 
<script type="text/javascript"> 
     var pageNaviConf = { 
     perPage: 6, 
      numPages: 5, 
      firstText: "First", 
      lastText: "Last", 
      nextText: "Next", 
      prevText: "Prev" 
     } 
     </script> 
<script type="text/javascript"> 
     //<![CDATA[ 
     function pageNavi(o){var m=location.href,l=m.indexOf("/search/label/")!=-1,a=l?m.substr(m.indexOf("/search/label/")+14,m.length):"";a=a.indexOf("?")!=-1?a.substr(0,a.indexOf("?")):a;var g=l?"/search/label/"+a+"?updated-max=":"/search?updated-max=",k=o.feed.entry.length,e=Math.ceil(k/pageNaviConf.perPage);if(e<=1){return}var n=1,h=[""];l?h.push("/search/label/"+a+"?max-results="+pageNaviConf.perPage):h.push("/?max-results="+pageNaviConf.perPage);for(var d=2;d<=e;d++){var c=(d-1)*pageNaviConf.perPage-1,b=o.feed.entry[c].published.$t,f=b.substring(0,19)+b.substring(23,29);f=encodeURIComponent(f);if(m.indexOf(f)!=-1){n=d}h.push(g+f+"&max-results="+pageNaviConf.perPage)}pageNavi.show(h,n,e)}pageNavi.show=function(f,e,a){var d=Math.floor((pageNaviConf.numPages-1)/2),g=pageNaviConf.numPages-1-d,c=e-d;if(c<=0){c=1}endPage=e+g;if((endPage-c)<pageNaviConf.numPages){endPage=c+pageNaviConf.numPages-1}if(endPage>a){endPage=a;c=a-pageNaviConf.numPages+1}if(c<=0){c=1}var b='<span class="pages">Pages '+e+' of '+a+"</span> ";if(c>1){b+='<a href="'+f[1]+'">'+pageNaviConf.firstText+"</a>"}if(e>1){b+='<a href="'+f[e-1]+'">'+pageNaviConf.prevText+"</a>"}for(i=c;i<=endPage;++i){if(i==e){b+='<span class="current">'+i+"</span>"}else{b+='<a href="'+f[i]+'">'+i+"</a>"}}if(e<a){b+='<a href="'+f[e+1]+'">'+pageNaviConf.nextText+"</a>"}if(endPage<a){b+='<a href="'+f[a]+'">'+pageNaviConf.lastText+"</a>"}document.write(b)};(function(){var b=location.href;if(b.indexOf("?q=")!=-1||b.indexOf(".html")!=-1){return}var d=b.indexOf("/search/label/")+14;if(d!=13){var c=b.indexOf("?"),a=(c==-1)?b.substring(d):b.substring(d,c);document.write('<script type="text/javascript" src="/feeds/posts/summary/-/'+a+'?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}else{document.write('<script type="text/javascript" src="/feeds/posts/summary?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}})(); 
     //]]> 
</script><script type="text/javascript" src="/feeds/posts/summary?alt=json-in-script&amp;callback=pageNavi&amp;max-results=99999"></script><span class="pages">Pages 2 of 6</span> <a href="/?max-results=6">Prev</a><a href="/?max-results=6">1</a><span class="current">2</span><a href="/search?updated-max=2016-02-11T02%3A17%3A00-08%3A00&amp;max-results=6">3</a><a href="/search?updated-max=2016-02-01T23%3A45%3A00-08%3A00&amp;max-results=6">4</a><a href="/search?updated-max=2016-01-31T21%3A48%3A00-08%3A00&amp;max-results=6">5</a><a href="/search?updated-max=2016-02-11T02%3A17%3A00-08%3A00&amp;max-results=6">Next</a><a href="/search?updated-max=2016-01-27T01%3A22%3A00-08%3A00&amp;max-results=6">Last</a> 
<div class="clear"></div> 
</div> 
+0

Hoşgeldin

Yolunda gitmeyen bu div kodu yayınlanmıştır! Kodun ne yapmak istediğinizi ve bunun yerine ne gördüğünü açıklamak alışılmış bir durumdur. "Çalışmıyor", bu sitedeki yayınların% 90'ını açıklıyor ve bu nedenle yeterince spesifik değil. ;-) – f1r3br4nd

+0

benim blog sikhtera.blogspot.com sayfa gezinme altta çalışmıyor sayfa numarası gösteriyor ama ben sayfa numarası üzerinde gezindiğinde devre dışı bırakılırlar. –

cevap

0

kullanımı bu: StackOverflow'daki için

<div class='pagenavi'> 
 
<script type='text/javascript'> 
 
var pageNaviConf = { 
 
perPage: 7, 
 
numPages: 5, 
 
firstText: &quot;First&quot;, 
 
lastText: &quot;Last&quot;, 
 
nextText: &quot;&#187;&quot;, 
 
prevText: &quot;&#171;&quot; 
 
} 
 
</script> 
 
<script type='text/javascript'>/* 
 

 
* Awesome Blogger Page Navigation by Onlinetrick * 
 
* Rev 248 on May 7, 2010 * 
 
* Source at http://code.google.com/p/rilwis/source/browse/trunk/blogger * 
 

 
*/ 
 

 

 
function pageNavi(o){ 
 
\t var m=location.href, 
 
\t \t l=m.indexOf("/search/label/")!=-1, 
 
\t \t a=l?m.substr(m.indexOf("/search/label/")+14,m.length):""; 
 
\t \t 
 
\t a=a.indexOf("?")!=-1?a.substr(0,a.indexOf("?")):a; 
 
\t 
 
\t var g=l?"/search/label/"+a+"?updated-max=":"/search?updated-max=", 
 
\t \t k=o.feed.entry.length, 
 
\t \t e=Math.ceil(k/pageNaviConf.perPage); 
 
\t 
 
\t if(e<=1){ 
 
\t \t return 
 
\t } 
 
\t var n=1, 
 
\t \t h=[""]; 
 
\t l?h.push("/search/label/"+a+"?max-results="+pageNaviConf.perPage):h.push("/?max-results="+pageNaviConf.perPage); 
 
\t 
 
\t for(var d=2;d<=e;d++){ 
 
\t \t var c=(d-1)*pageNaviConf.perPage-1, 
 
\t \t \t b=o.feed.entry[c].published.$t, 
 
\t \t \t f=b.substring(0,19)+b.substring(23,29); 
 
\t \t \t 
 
\t \t f=encodeURIComponent(f); 
 
\t \t 
 
\t \t if(m.indexOf(f)!=-1){ 
 
\t \t \t n=d 
 
\t \t } 
 
\t \t 
 
\t \t h.push(g+f+"&max-results="+pageNaviConf.perPage) 
 
\t } 
 
\t 
 
\t pageNavi.show(h,n,e) 
 
} 
 

 
pageNavi.show=function(f,e,a){ 
 
\t var d=Math.floor((pageNaviConf.numPages-1)/2), 
 
\t \t g=pageNaviConf.numPages-1-d, 
 
\t \t c=e-d; 
 
\t if(c<=0){ 
 
\t \t c=1 
 
\t } 
 
\t endPage=e+g; 
 
\t if((endPage-c)<pageNaviConf.numPages){ 
 
\t \t endPage=c+pageNaviConf.numPages-1 
 
\t } 
 
\t if(endPage>a){ 
 
\t \t endPage=a; 
 
\t \t c=a-pageNaviConf.numPages+1 
 
\t } 
 
\t if(c<=0){ 
 
\t \t c=1 
 
\t } 
 
\t 
 
\t var b='<span class="pages">Page '+e+' of '+a+"</span> "; 
 
\t 
 
\t if(c>1){ 
 
\t \t b+='<a href="'+f[1]+'">'+pageNaviConf.firstText+"</a>" 
 
\t } 
 
\t if(e>1){ 
 
\t \t b+='<a href="'+f[e-1]+'">'+pageNaviConf.prevText+"</a>" 
 
\t } 
 
\t for(i=c;i<=endPage;++i){ 
 
\t \t if(i==e){ 
 
\t \t \t b+='<span class="current">'+i+"</span>" 
 
\t \t \t }else{ 
 
\t \t \t b+='<a href="'+f[i]+'">'+i+"</a>" 
 
\t \t } 
 
\t } 
 
\t if(e<a){ 
 
\t \t b+='<a href="'+f[e+1]+'">'+pageNaviConf.nextText+"</a>" 
 
\t } 
 
\t if(endPage<a){ 
 
\t \t b+='<a href="'+f[a]+'">'+pageNaviConf.lastText+"</a>" 
 
\t } 
 
\t 
 
\t document.write(b) 
 
}; 
 
\t 
 
(function(){var b=location.href;if(b.indexOf("?q=")!=-1||b.indexOf(".html")!=-1){return}var d=b.indexOf("/search/label/")+14;if(d!=13){var c=b.indexOf("?"),a=(c==-1)?b.substring(d):b.substring(d,c);document.write('<script type="text/javascript" src="/feeds/posts/summary/-/'+a+'?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}else{document.write('<script type="text/javascript" src="/feeds/posts/summary?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}})();</script> 
 
<div class='clear'/> 
 
</div>