/*blog modul css id = pa-blog-load-more*/ /*přidat tlačítko a dát css id= pa_load_more*/ /*vložit kód do head*/ <script> jQuery(document).ready(function(){ //For mobile Screens if (window.matchMedia('(max-width: 767px)').matches) { var initial_show_article = 3; var article_reveal = 2; jQuery(".pa-blog-load-more article").not( ":nth-child(-n+"+initial_show_article+")" ).css("display","none"); jQuery("#pa_load_more").on("click", function(event){ event.preventDefault(); initial_show_article = initial_show_article + article_reveal; jQuery(".pa-blog-load-more article").css("display","block"); jQuery(".pa-blog-load-more article").not( ":nth-child(-n+"+initial_show_article+")" ).css("display","none"); var articles_num = jQuery(".pa-blog-load-more article").not('[style*="display: block"]').length if(articles_num == 0){ jQuery(this).css("display","none"); } }) } else { //For desktop Screens var initial_row_show = 1; var row_reveal = 2; var total_articles = jQuery(".pa-blog-load-more article").length; jQuery(".pa-blog-load-more article").not( ":nth-child(-n+"+initial_row_show+")" ).css("display","none"); jQuery("#pa_load_more").on("click", function(event){ event.preventDefault(); initial_row_show = initial_row_show + row_reveal; jQuery(".pa-blog-load-more article").css("display","block"); jQuery(".pa-blog-load-more article").not( ":nth-child(-n+"+initial_row_show+")" ).css("display","none"); var articles_num = jQuery(".pa-blog-load-more article").not('[style*="display: block"]').length if(articles_num == 0){ jQuery(this).css("display","none"); } }) } }) </script>
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter