-->
in feeds
250x250

Cara Membuat Spoiler Keren di Blog dengan jQuery

hpk
250x250
in artikel
Cara Membuat Spoiler Keren di Blog dengan jQuery
Cara Membuat Spoiler di Dalam Postingan Ala TKJMBAYO - Assalamualaikum, spoiler biasa diartikan sebagai 'bocoran'.Guna spoiler dalam postingan adalah memangkas panjang layout postingan dengan menyembunyikan kalimat / kode tertentu.Ya, intinya sih biar irit jadi scroll dalam halaman tidak panjang banget.

Cara kerjanya cukup mudah, yaitu dengan menekan tombol lalu kalimat / kode akan muncul.Ya seperti yang sudah saya ketik barusan, fungsinya untuk menyembunyikan kalimat.

Apa yang dibutuhkan?

  • Bootstrap CSS
  • jQuery


Memasukkan Script dan CSS di Template


Pertama - tama, masukkan CDN Bootstrap Terbaru untuk menset CSSnya.

Letakkan kode dibawah pada bagian atas </head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />

 Kedua, masukkan script jQuery di section (diatas atau dibawah terserah ) </head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

Ketiga, masukkan kode dibawah di section </head>


<style>
#spoiler{display: none;border: 2px solid black;background: #b99446;outline-color: #280cf3;padding-left: 5px;}

#spoiler1{display: none;border: 2px solid black;background: #b99446;outline-color: #280cf3;padding-left: 5px;}

#spoiler2{display: none;border: 2px solid black;background: #b99446;outline-color: #280cf3;padding-left: 5px;}

#spoiler3{display: none;border: 2px solid black;background: #b99446;outline-color: #280cf3;padding-left: 5px;}
</style>

Membuat Spoiler pada Mode HTML

Masukkan kode dibawah pada Mode HTML pada saat akan membuat postingan baru.


Keterangan :

  1. Ganti tulisan "Spoiler Alertt!!!!" dengan selera kalian masing - masing sebagai display tulisan pada tombol.
  2. Taruh kalimat / kode kalian pada bagian --Kode / Kalimat disini

Membuat spoiler di blog lebih dari 1

Spoiler Kedua

<button class="btn btn-danger btn-lg">Spoiler Alertt!!!!</button>
<div id="spoiler1">
--Kode / Kalimat disini
</div>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#spoiler1").toggle(1000);
    });
});
</script>

Spoiler ketiga :

<button class="btn btn-danger btn-lg">Spoiler Alertt!!!!</button>
<div id="spoiler2">
--Kode / Kalimat disini
</div>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#spoiler2").toggle(1000);
    });
});
</script>

Tambahkan kode - kode diatas lalu ganti <div id="spoiler"> sampai seterusnya / seperlunya saja.

Apakah menggunakan spoiler di blog dapat memperlambat loading blog?

Tentunya, seiring bertambahnya script ataupun css loading pada blog akan terasa lebih lama.Meskipun demikian, dengan menggunakan spoiler justru membuat loading blog lebih cepat karena akan mempersingkat layout postingan.Asalkan digunakan dengan bijak dan tidak berlebihan karena segala sesuatu yang berlebihan kan tidak baik.

Sekian Terimakasih :)
Wassalamualaikum
300x600
the cheapest car insurance cost of car insurance best car insurance quotes insurance auto insurance quotes car get car insurance quotes online car insurance agent instant car insurance quote car insurance websites direct car insurance insure a car motor car insurance quote cheap car insurance online quotes for car insurance car insurers commercial car insurance motor insurance quote car insurance quotes online get a quote online international health insurance compare car insurance quotes insurance for car compare car insurance car insurance buy life insurance online compare auto insurance international medical insurance general car insurance cheap motor insurance low car insurance car insurance comparison company car insurance budget car insurance private health insurance online quote car insurance cheap motor car insurance car insurance for new drivers cheap car insurance quotes online online car insurance quotes get car insurance quotes car insurance quotes comparison motor car insurance car insurance quotes car insurance cheap comprehensive car insurance best auto insurance short term health insurance motor insurance cheap online car insurance online motor insurance quotes car insurance california buycarinsurance online vehicle insurance free car insurance quotes landlord insurance health insurance for children motorbike insurance monthly car insurance car insurance usa car insurance reviews car insurance renewal quotes vehicle insurance health insurance rates term life insurance quotes vehicle insurance quotes car insurance compare motor vehicle insurance best car insurance motor insurance online quote car insurance online quote life insurance online supplemental health insurance best car insurance rates car insurance discounts motor vehicle insurance quotes auto insurance cheap travel insurance bike insurance travel medical insurance buy car insurance online online motor insurance travel insurance quote get a quote for car insurance health insurance agent car insurance companies cheap car insurance companies travel insurance annual travel insurance commercial vehicle insurance permanent life insurance medical insurance quotes online car insurance cheap car insurance quotes car insurance online quote insurance online level term life insurance health insurance comparison how much is car insurance travel health insurance pet health insurance quotes on cars health ins travel insurance uk quote for car insurance get insurance quote online disability insurance quote temporary health insurance temporary insurance rental car insurance cheap health insurance auto insurance compare third party car insurance buy health insurance auto insurance quotes cheap insurance companies best term life insurance personal health insurance online quote insurance car insurance premium health insurance policies quotes for cars whole life insurance credit insurance cheap van insurance cheap term life insurance cheap motorcycle insurance compare life insurance car insurance cover health insurance motorcycle insurance short term car insurance health insurance coverage insurance qoute cheap life insurance house insurance quote car insurance uk health insurance companies cigna health insurance cheap insurance cheap car insurance uk compare health insurance car insurance for young drivers short term insurance online health insurance caravan insurance life insurance comparison direct insurance health insurance plans motor insurance online car insurance estimator accident insurance home insurance quotes nj car insurance new car insurance private medical insurance home insurance car insurance brokers car insurance rates commercial insurance health insurance quotes motor insurance companies which car insurance car quotes online online auto insurance flood insurance cheap auto insurance quotes car insurance agencies business health insurance term life insurance truck insurance professional indemnity insurance life insurance car insurance policy long term care insurance drive insurance buy insurance car ins motorcycle insurance quote critical illness insurance term insurance student health insurance home insurance comparison insurance rates insurance cover holiday insurance insurance sites online vehicle insurance quotes company website home insurance rates compare insurance buy insurance online affordable medical insurance car insurance coverage product liability insurance home contents insurance buy life insurance renters insurance group health insurance family health insurance motor insurance quote online mortgage insurance best home insurance personal insurance medical insurance property insurance life insurance agent group insurance aetna health insurance cheap medical insurance liability insurance rental insurance life insurance policy group life insurance general liability insurance insurance quotes online all car insurance companies best health insurance insurance plans life insurance for seniors van insurance website quote universal life insurance building insurance co insurance insurance car car insurance prices disability insurance insurance vehicle cheap vehicle insurance senior life insurance medical insurance plans insurance health house insurance life insurance quotes car quotes cheap home insurance

1 Response to "Cara Membuat Spoiler Keren di Blog dengan jQuery"

Sabun Bekas Jerawat said...

terimakasih atas informasinya, jangan lupa kunjungi kami
di http://blackwaletfacialsoap.com/sabun-bekas-jerawat/

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel

close
[ klik disini 1X ] [ close ]