Copyright: Blog Trik dan Tips - http://blogtrikdantips.blogspot.com/2012/04/mempercepat-loading-blog-dengan-chrome.html#ixzz2BC5f6lay Tolong sertakan link ini jika mengkopi artikel diatas. Terima kasih

WELCOME TO

Cara Membuat Related Post Slide Out Boxs Di Blog

Cara Membuat Related Post Slide Out Boxs Di Blog - Rasanya sudah lama saya nggak sempat update blog karena banyak kesibukan di dunia nyata, berhubugan akan menjelang hari raya pengrupuk dan nyepi jadi umat Hindu lagi sibuk mepersiapkan yg namanya Ogoh -ogoh! Nah, pada kesempatan kali ini, saya akan berbagi satu widget yang tidak kalah menariknya dengan widget related post with thumbnail. widget Related Post Slide Out Boxs menurut saya belum banyak yang memakai mungkin karena fiturnya agak janggal sedikit karena kurang feednya. nah biar nggak kelamaan mari kita lihat demonya dibawah ini.




Bagaimana, menarik bukan? jika sobat tertarik, mari kita pasang widget ini di blog sobat. ikuti langkah sebagai berikut :


1. Pergi ke Template/Rancangan > Edit Html
2. Cari kode <b:skin> dan letakan kode CSS berikut diatas kode <b:skin>   
 




<link href='http://tympanus.net/Tutorials/RelatedPostsSlideOuts/css/style.css' media='screen' rel='stylesheet' type='text/css'/>







3. Selanjutnya cari dan letakan kode JS berikut diatas kode



<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' type='text/javascript'/>  <script>//<![CDATA[   $(function() {    /**    * the list of posts    */    var $list   = $('#rp_list ul');    /**    * number of related posts    */    var elems_cnt   = $list.children().length;        /**    * show the first set of posts.    * 200 is the initial left margin for the list elements    */    load(200);        function load(initial){     $list.find('li').hide().andSelf().find('div').css('margin-left',-initial+'px');     var loaded = 0;     //show 5 random posts from all the ones in the list.      //Make sure not to repeat     while(loaded < 5){      var r   = Math.floor(Math.random()*elems_cnt);      var $elem = $list.find('li:nth-child('+ (r+1) +')');      if($elem.is(':visible'))       continue;      else       $elem.show();      ++loaded;     }     //animate them     var d = 200;     $list.find('li:visible div').each(function(){      $(this).stop().animate({       'marginLeft':'-50px'      },d += 100);     });    }         /**    * hovering over the list elements makes them slide out    */     $list.find('li:visible').live('mouseenter',function () {     $(this).find('div').stop().animate({      'marginLeft':'-220px'     },200);    }).live('mouseleave',function () {     $(this).find('div').stop().animate({      'marginLeft':'-50px'     },200);    });        /**    * when clicking the shuffle button,    * show 5 random posts    */    $('#rp_shuffle').unbind('click')        .bind('click',shuffle)        .stop()        .animate({'margin-left':'-18px'},700);            function shuffle(){     $list.find('li:visible div').stop().animate({      'marginLeft':'60px'     },200,function(){      load(-60);     });    }            });  //]]></script>



4. Sekarang letakan struktur HTML ini juga diatas kode </body>


<div class='rp_list' id='rp_list'><ul><li><div><img height='72' width='72' alt='Download Template Zoom Gallery' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBh9o6MxkZGzqt_iAlQlAOwLYTP0A7NcdH9wZ5au72Fjoj5ESwGL2ZAkFeMho8UcBMzGE-_hGKjZpl8RS4I8zrKsMQCLIB75zBcW4V2P-jdftclHjhmGrjfSWMdxNn3uW7VZLCH6ZYhdo/s72-c/zoom-gallery.jpg'/><span class='rp_title'>Download Template Zoom Gallery</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template Blogger Tune-Up' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4gtn9BQkP9d7DKijKkMOS-03IGp3PVDYNLayHDXKRbfcGtAS5bKi6JkPOoVpYiogCy5kxZRzp3gUvqNVF8H7HeLiJA4uCl4RKOj-m_S3OhodO8Ytb6Gb69Sa82FpBeTEgox0Za7CKDr4/s72-c/download-template-blogger-tune-up.jpg'/><span class='rp_title'>Download Template Blogger Tune-Up</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template Today' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6Ep454O9tcmq1dXFVftyIMBYxKpVX0C2FdQfYb5IEv4MVPfg0Uaj6R4kqvSTp5_5VoYjr7ssgs4RPyCFx6FCn4Ethj_Px5x6KW__od11m2IyZG99Q33BTuXkXanreN5pk_OsPY_kJibk/s72-c/download-template-today.jpg'/><span class='rp_title'>Download Template Today</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template Kolom Tutorial' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitSmj_OPVeptt_1IvC4uzkYEkuJpe_kZafq2xfqIEi6TW53d8ZosJCkdS2nY9qEF18NDgAx751rkmsLLn4GDrOm-s80oOZGlzWnXFKNpEXb64gSOYGMXN5MoOfNFcRLfDeAX0m-wuXVrY/s72-c/kolom-tutorial.blogspot.com_medium.jpg'/><span class='rp_title'>Download Template Kolom Tutorial</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template Sporty Magazine 2' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvKo_8dOjk0XV6RW9JJvJzt2-LLpTmMnSwulx8XLrjTVu6fpxsNoNxZ3ffHouxoNg0AOULYvzdKjXgzfD4jHJ_He_-M5eQsEwtocGjWdQzYQvDTTo71cOZpmR9CaNr4dRLkexNF3MKDF8/s72-c/Sporty+Magazine+2.png'/><span class='rp_title'>Download Template Sporty Magazine 2</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template Blog Juragan' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg51XFZTwQHqN-zMhnthD3YSI3GyHhha3eqN-9EMQamvAv02-bTopHUyUiScxP8CdwAovN0iZhyphenhyphenwre3bgM1tvgmNqgxBnlK26O3rY_fF4sROO9zKUdD6faqedoQrcSGJKejVNWIpBqy39M/s72-c/blog_juragan.jpg'/><span class='rp_title'>Download Template Blog Juragan</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
<li><div><img height='72' width='72' alt='Download Template O-om' src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAfsM9lnSifRHIKD_uaojtIFu_wMrLqdoqZdVfGwmssLIAPcA12Xo9RUMfYW63ZMC5_FSzn-xcFWFWjEUBV37l1Y_8V_Ccfg1fh7oZwZYU8l3kHcSjwg6XaqYPy_MWDrkTOzOCvp3z7qQ/s72-c/download_template_o-om.jpg'/><span class='rp_title'>Download Template O-om</span><span class='rp_links'><a href='http://darmasite.blogspot.com/' target='_blank'>Article</a><a href='http://darmasite.blogspot.com/' target='_blank'>Demo</a></span></div></li>
</ul><span class='rp_shuffle' id='rp_shuffle'/></div>


Struktur diatas hanyalah sebuah contoh jika anda ingin merubah thumbnail image, judul dan link. yang perlu Anda rubah adalah seperti struktur berikut


<li><div><img height='72' width='72' alt='JUDUL-IMG' src='URL-IMAGE'/><span class='rp_title'>JUDUL-POST</span><span class='rp_links'><a href='LINK-ARTIKEL' target='_blank'>Article</a><a href='LINK-DEMO' target='_blank'>Demo</a></span></div></li>


Sobat bisa menambahkan struktur tersebut minimal 5. Dalam JavaScript kita akan mendefinisikan bahwa hanya menampilkan 5 posting pada suatu waktu. Tentu saja, sobat harus mengganti teks berwana dengan link dan judul sobat.

5. Terakhir Klik Save Template
 
 
Sumber : Hacker Baturaja

Posting Komentar - Back to Content