Content Pagination with Reload Page For Blogger With Javascript - KhalistaBlog -->
Skip to content Skip to sidebar Skip to footer

Content Pagination with Reload Page For Blogger With Javascript

Content Pagination with Reload Page For Blogger With Javascript - Content pagination serves to divide a content into multiple pages by displaying pager numbers according to many pages created so as to facilitate the navigation of visitors to view the next content.

Content pagination with reload page for blogger with JavaScript I created it because quite a lot are looking its way. With this when the visitor clicks on the pager to read the next content, then in addition to the content that also switch automatically automatically reloading the page so that the ad content on the page also changes.

With this expected visitors can see more ads in each content raised. So the chances of clicks become larger. This is safer to do than to use meta refresh which is not recommended.

Content Pagination with Reload Page For Blogger With Javascript

Content pagination with reload page for blogger with javascript I created only up to 5 pages only, but it is possible in the future I fix it in order to be free to create more than 5 pages of content. Content pagination by reloading this page created with javascript without requiring jquery library so it will not be much interrupt loading blog page. If you are interested to try it, we can immediately follow some steps below.

Content Pagination with Reload Page For Blogger With Javascript


Please use the following code in the HTML code post to create a post with pagination content with this reload page.

<style>
.button-box{margin:30px 0;text-align:center;}
#page1,#page2,#page3,#page4,#page5{display:none}
#page1.current{display:block}
a.button-pager{height:30px;line-height:30px;padding:0 20px; margin:0 5px 0 0;text-align:center;background:#ddd;color:#333;cursor:pointer;display:inline-block;}
a.button-pager.current{background:#333;color:#fff;}
</style>
<div id='topcontent'></div>
<div id="page1" class="current">
Content 1 tulis di sini......
</div>
<div id="page2">
Content 2 tulis di sini......
</div>
<div id="page3">
Content 3 tulis di sini......
</div>
<div id="page4">
Content 4 tulis di sini......
</div>
<div id="page5">
Content 5 tulis di sini......
</div>
<div class="button-box">
<a class="button-pager current" id="button1" href="?page1#topcontent">1</a>
<a class="button-pager" id="button2" href="?page2#topcontent">2</a>
<a class="button-pager" id="button3" href="?page3#topcontent">3</a>
<a class="button-pager" id="button4" href="?page4#topcontent">4</a>
<a class="button-pager" id="button5" href="?page5#topcontent">5</a>
</div>
<script>
//<![CDATA[
var p1=document.getElementById("page1"),p2=document.getElementById("page2"),p3=document.getElementById("page3"),p4=document.getElementById("page4"),p5=document.getElementById("page5"),b1=document.getElementById("button1"),b2=document.getElementById("button2"),b3=document.getElementById("button3"),b4=document.getElementById("button4"),b5=document.getElementById("button5");window.location.href.search("page1")>0&&(p1.style.display="block",p1.classList.add("current"),b1.classList.add("current"),p2.style.display="none",p2.classList.remove("current"),b2.classList.remove("current"),p3.style.display="none",p3.classList.remove("current"),b3.classList.remove("current"),p4.style.display="none",p4.classList.remove("current"),b4.classList.remove("current"),p5.style.display="none",p5.classList.remove("current"),b5.classList.remove("current")),window.location.href.search("page2")>0&&(p1.style.display="none",p1.classList.remove("current"),b1.classList.remove("current"),p2.style.display="block",p2.classList.add("current"),b2.classList.add("current"),p3.style.display="none",p3.classList.remove("current"),b3.classList.remove("current"),p4.style.display="none",p4.classList.remove("current"),b4.classList.remove("current"),p5.style.display="none",p5.classList.remove("current"),b5.classList.remove("current")),window.location.href.search("page3")>0&&(p1.style.display="none",p1.classList.remove("current"),b1.classList.remove("current"),p2.style.display="none",p2.classList.remove("current"),b2.classList.remove("current"),p3.style.display="block",p3.classList.add("current"),b3.classList.add("current"),p4.style.display="none",p4.classList.remove("current"),b4.classList.remove("current"),p5.style.display="none",p5.classList.remove("current"),b5.classList.remove("current")),window.location.href.search("page4")>0&&(p1.style.display="none",p1.classList.remove("current"),b1.classList.remove("current"),p2.style.display="none",p2.classList.remove("current"),b2.classList.remove("current"),p3.style.display="none",p3.classList.remove("current"),b3.classList.remove("current"),p4.style.display="block",p4.classList.add("current"),b4.classList.add("current"),p5.style.display="none",p5.classList.remove("current"),b5.classList.remove("current")),window.location.href.search("page5")>0&&(p1.style.display="none",p1.classList.remove("current"),b1.classList.remove("current"),p2.style.display="none",p2.classList.remove("current"),b2.classList.remove("current"),p3.style.display="none",p3.classList.remove("current"),b3.classList.remove("current"),p4.style.display="none",p4.classList.remove("current"),b4.classList.remove("current"),p5.style.display="block",p5.classList.add("current"),b5.classList.add("current"));
//]]>
</script>

Please adjust the content of the page and its buttons as needed. But you can also save the style of CSS and its JavaScript in HTML editing to make it more simple when making its post.

That's the tips about Content Pagination with Reload Page For Blogger With Javascript, hopefully with this article I've shared this, can be useful and good luck.

Post a Comment for "Content Pagination with Reload Page For Blogger With Javascript"