Postingan

Menampilkan postingan dengan label Code Snippet

Animasi Blog Roll

var $ul = $('#blog-roll'), roll = function() { $ul.find('li').first().slideUp('slow', function() { $(this).appendTo($(this).parent()).fadeIn(); }); }, anim = setInterval(roll, 3000); // Pause on hover... $ul.hover(function() { clearInterval(anim); }, function() { setInterval(roll, 3000); }); Demo

Blogger JSON - Top Commentators

<!DOCTYPE html> <html> <head> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/> <title>Top Commentators</title> <style type="text/css"> .top-commenter-line { margin:3px 0px; } .top-commenter-avatar { display:inline-block; vertical-align:middle; } </style> </head> <body> <script type="text/javascript"> // Top Commentators gadget with avatars, by MS-potilas 2012. // Gets a list of top commentators from all comments, or specified number of days in the past. // See http://yabtb.blogspot.com/2012/05/top-commenters-gadget-with-avatars.html // CONFIG: var homepage = 'http://latitudu.blogspot.com', // Homepage maxTopCommenters = 17, // How much? minComments = 1, // How many comments must top commentator have at least numDays = 0, // From how many days (ex. 30), or 0 from "all the time" excludeMe ...

Dua Versi Konverter HTML

Gambar
Membuat konverter HTML dengan JavaScript atau JQuery Versi JavaScript Mentah Konverter HTML dengan JavaScript mentah bisa dibuat dengan mudah. Tambahkan sebuah elemen halaman HTML/JavaScript , kemudian salin kode ini dan letakkan di dalam formulirnya: <style type="text/css"> #codes { border:1px solid #666; width:98%; height:200px; margin:5px auto 10px; display:block; } .button-group { margin:0 auto; text-align:center; } </style> <textarea id="codes"placeholder="Tulis/paste kode di sini lalu klik 'Konversi'"></textarea> <div class="button-group"> <button onclick="cdConvert();">Konversi</button> <button onclick="cdClear();">Bersihkan</button> </div> <script type="text/javascript"> function cdClear() { var wtarea = document.getElementById('codes'); wtarea.value = ''; } function cdConvert() { v...

Dasar JSON Feeds untuk Blogger

Gambar
Berikut ini adalah dasar JSON Feed untuk memanggil data posting pada situs-situs blogspot . Ini adalah langkah awal untuk mulai belajar menciptakan widget daftar isi atau recent post secara mandiri: function showrecentposts (json) { // start a loop // in this loop we get the entry from the feed and parse it for (var i = 0; i < numposts; i++) { // get entry i from feed var entry = json.feed.entry[i]; // get the posttitle var posttitle = entry.title.$t; // get the post url // check all links for the link with rel = alternate var posturl; if (i == json.feed.entry.length) break; for (var k = 0; k < entry.link.length; k++) { if (entry.link[k].rel == 'alternate') { posturl = entry.link[k].href; break; } } // get the postdate, take only the first 10 characters var postdate = entry.published.$t.substring(0,10); // get the post author var postauthor = entry.author[0].name.$t; // get the...