Langsung ke konten utama

Cara Membuat Gadget Melayang di Blog

Membuat gadget atau widget blog menjadi melayang merupakan hal yang sangat bermanfaat ketika sobat ingin pengunjung blog terus melihat gadget tersebut, contoh yang paling banyak digunakan adalah gadget sosial media (facebook like, google+ follower ataupun follow twitter) seperti yang saya gunakan pada Dewa Inside Blog ini yang berada disamping blog.
Gadget Melayang
Mungkin Sobat juga tertarik:
a. Memberi Warna Background Judul Gadget Blog
b. Menambah Gadget disamping Header Blog
c. Menampilkan/Menyembunyikan Gadget di Blog

Apakah Oke Digunakan pada Gadget Google Adsense?
Tidak boleh! Saya berani bilang tidak boleh karena saya baca Modification of Adsense ad code (Translate apabila sobat kurang paham bahasa inggris) disitu tertulis jelas salah satu teknik yang harus dihindari adalah "Floating ads or units that slide to attract unwarranted attention" membuat adsense melayang. Coba sobat lihat blog/website terkenal iklan google adsense-nya pasti statis saja. Lagipula saya lebih mencari traffic blog dengan menggunakannya pada gadget sosial media.

Cara Memasang:
1. Lihat ke Tata Letak --> Edit gadget yang ingin ditampilkan.
Edit Gadget

Disini hanya untuk melihat ID dari gadget tersebut. Klik pada bar url dan cari pada bagian kanan bar. Copy atau ingat ID Gadget yang ingin sobat buat melayang.
ID Gadget Blogger

2. Lihat ke Template --> Edit HTML, klik kiri pada kotak Edit HTML dan cari (CTRL+F) kode:
]]></b:skin>
Copy dan Paste kode CSS berikut diatas/sebelumnya:
.ET_floating {background:#ffffff !important; position:fixed !important; top:0; z-index:9999; box-shadow:0px 10px 4px -5px rgba(0,0,0,0.3); margin-top: 0; position:relative\9 !important;}
3. Cari kode:
</body>
Copy dan Paste kode berikut diatas/sebelumnya:
<script>
// Sticky widget
// EasyTins Tutorial
//<![CDATA[
ET_makeSticky("HTML1");
function ET_makeSticky(elem) {
    var ET_sticky = document.getElementById(elem);
    var scrollee = document.createElement("div");
    ET_sticky.parentNode.insertBefore(scrollee, ET_sticky);
    var width = ET_sticky.offsetWidth;
    var iniClass = ET_sticky.className + ' ET_sticky';
    window.addEventListener('scroll', ET_floating, false);
    function ET_floating() {
        var rect = scrollee.getBoundingClientRect();
        if (rect.top < 0) {
            ET_sticky.className = iniClass + ' ET_floating';
            ET_sticky.style.width = width + "px";
        } else {
            ET_sticky.className = iniClass;
        }
    }
}
//]]>
</script>
    Note: Ganti HTML1 yang berwarna merah dengan ID Gadget sobat yang ingin dibuat melayang.

4. Simpan Template
Coba lihat blog sobat dan scroll kebawah apakah gadget-nya sudah melayang mengikuti scroll kebawahnya. Apabila ada pertanyaan silahkan tinggalkan pada kolom komentar.

Selamat mencoba dan semoga berhasil.

Komentar

Postingan populer dari blog ini

Juggernaut - Relic Blade of the Kuur-Ishiminari

This is mod sword of Juggernaut - Relic Blade of the Kuur-Ishiminari Dota 2 Reborn common weapon. This item originally from Lost Treasure of the Ivory Isles (Series 3). Green beautiful ambient effect will shown when idle and especially if Yurnero using his 1st skill "blade fury". Mod type: Standart . Hope you guys like this mod and support our favorite game in steam community market. The essence of gaming is fun. No money? Just mods. Enjoy the game and boost your MMR! For installation mod guide: How to install mods with vpk creator . Juggernaut - Relic Blade of the Kuur-Ishiminari

Terrorblade - Foulfell Corruptor

Terrorblade - Foulfell Corruptor mod mythical item Dota 2 Reborn from Treasure of the Emerald Revival with ultra rare chance to get it. This set has ambient effect on the weapon, Blades of the Foulfell Corruptor. This set items consists of: Armor of the Foulfell Corruptor, Demon Form of the, Foulfell Corruptor, Blades of the Foulfell Corruptor, Wings of the Foulfell Corruptora and Helm of the Foulfell Corruptor. It can be combine with  Terrorblade - Fractal Horns of Inner Abysm arcana mod. Hope you guys like this mod and support our favorite game in steam community market. No money? Just mods.The essential gaming is fun. Enjoy the game and boost your mmr!

Axe - Snowpack Savage

Mod skin Axe - Snowpack Savage rare item Dota 2 Reborn from Fortivus 2017 Treasure. This item consists of : Axe of the Snowpack Savage, Beard of the Snowpack Savage, Armor of the Snowpack Savage, Belt of the Snowpack Savage and Prize of the Snowpack Savage . Mod type: Standart . Hope you guys like this mod and support our favorite game in steam community market. The essence of gaming is fun. No money? Just mods. Enjoy the game and boost your MMR! For installation mod guide: How to install mods with vpk creator . Axe - Snowpack Savage