{"id":3033,"date":"2018-04-11T05:18:15","date_gmt":"2018-04-11T05:18:15","guid":{"rendered":"https:\/\/docs.contentviewspro.com\/?p=3033"},"modified":"2023-12-27T11:08:50","modified_gmt":"2023-12-27T11:08:50","password":"","slug":"pagination-trigger-custom-javascript-action-clicking-pagination-number","status":"publish","type":"docs","link":"https:\/\/contentviewspro.com\/documentation\/article\/pagination-trigger-custom-javascript-action-clicking-pagination-number\/","title":{"rendered":"Pagination &#8211; trigger custom Javascript action after clicking a page number"},"content":{"rendered":"<p>Content Views and Content Views Pro helps you to show posts, pages, etc. with pagination easily.<\/p>\n<p>To trigger custom Javascript action after clicking a pagination number, please use this Javascript code:<\/p>\n<pre style=\"font-size:13px\">\n\/*Pagination \u2013 trigger custom Javascript action after clicking*\/\n$('body').on('pt-cv-pagination-finished pt-cv-pagination-finished-simple', function(e, pages_holder, $loaded_content) {\n    \/\/ add your JS code here\n});\n<\/pre>\n<p>It works with Ajax load-more and infinite scrolling pagination too. Your event will be triggered after the new page finishes loading.<\/p>\n<p>Best regards,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Content Views and Content Views Pro helps you to show posts, pages, etc. with pagination easily. To trigger custom Javascript action after clicking a pagination number, please use this Javascript code: \/*Pagination \u2013 trigger custom Javascript action after clicking*\/ $(&#8216;body&#8217;).on(&#8216;pt-cv-pagination-finished pt-cv-pagination-finished-simple&#8217;, function(e, pages_holder, $loaded_content) { \/\/ add your JS code here }); It works with &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/contentviewspro.com\/documentation\/article\/pagination-trigger-custom-javascript-action-clicking-pagination-number\/\"> <span class=\"screen-reader-text\">Pagination &#8211; trigger custom Javascript action after clicking a page number<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"doc_category":[55],"doc_tag":[36],"class_list":["post-3033","docs","type-docs","status-publish","hentry","doc_category-advanced-modification","doc_tag-custom-js"],"year_month":"2026-09","word_count":76,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin1","author_nicename":"admin1","author_url":"https:\/\/contentviewspro.com\/documentation\/author\/admin1\/"},"doc_category_info":[{"term_name":"Advanced Modification","term_url":"https:\/\/contentviewspro.com\/documentation\/cats\/advanced-modification\/"}],"doc_tag_info":[{"term_name":"custom JS","term_url":"https:\/\/contentviewspro.com\/documentation\/tags\/custom-js\/"}],"_links":{"self":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/comments?post=3033"}],"version-history":[{"count":1,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3033\/revisions"}],"predecessor-version":[{"id":5447,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/docs\/3033\/revisions\/5447"}],"wp:attachment":[{"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/media?parent=3033"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_category?post=3033"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/contentviewspro.com\/documentation\/wp-json\/wp\/v2\/doc_tag?post=3033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}