Apa Itu Collapsible dan Bagaimana Cara Membuatnya

Apa itu collapsible dan bagaimana cara membuatnya Bisanya saya menyebutnya collapsible ini dengan sebutan plugin, karena dengan kita menggunakan collapsible ini, kita akan membangun penjelasan dengan rapi, dimana penjelasan atau penjelasan tersebut akan muncul ketika di klik judulnya, layaknya seperti fitur dropown, tetapi seandainya collapsible ini yang keluar deskripsinya bukan sub menunya, Oke jangan kemana-mana simak terus ya teman-teman.





Bagi belajar apa itu collapsible dan bagaimana cara membuatnya, saya masih menggunakan library materialize ya teman-teman, teman-teman dapat seketika kunjungi, dan saya harap teman-teman telah paham menggunakan materialize ini ya, seandainya belum teman-teman dapat lihat di artikel sebelumnya atau search saja di google bagaimana cara menggunakan materialize, gampang ko teman-teman, oke seketika saja bagaimana cara membuatnya:



  <!DOCTYPE html>
<html>
<head>
<title>Apa itu Collapsible dan Bagaimana Cara Membuatnya</title>
<!--Import Google Icon Font-->
<link href=https://fonts.googleapis.com/icon?family=Material+Icons rel=stylesheet>
<!--Import materialize.css-->
<link type=text/css rel=stylesheet href=css/materialize.min.css media=screen,projection/>
<!--Let browser know blog is optimized for mobile-->
<meta name=viewport content=width=device-width, initial-scale=1.0/>
<-e-style type=text/css>
.container{
width: 1000px;
margin: auto;
}
</style>
</head>
<body>
<div class=container>
<h1>Apa itu Collapsible dan Bagaimana Cara Membuatnya</h1>
<ul class=collapsible data-collapsible=accordion>
<li>
<div class=collapsible-header><i class=material-icons>monetization_on</i>Mata uang</div>
<div class=collapsible-body><span>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</span></div>
</li>
<li>
<div class=collapsible-header><i class=material-icons>local_atm</i>Kenapa Mesti ada mata uang</div>
<div class=collapsible-body><span>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, l</span></div>
</li>
<li>
<div class=collapsible-header><i class=material-icons>star</i>Mata uang apa yang terdapat di indonesia</div>
<div class=collapsible-body><span>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
</span></div>
</li>
</ul>
<p>
</p>
<!--Import jQuery before materialize.js-->
<-e-script type=text/javascript src=https://code.jquery.com/jquery-3.2.1.min.js></script>
<-e-script type=text/javascript src=js/materialize.min.js></script>
<-e-script type=text/javascript>
$(document).ready(function(){
$('.collapsible').collapsible();
});
<-e-/script>
</div>
</body>
</html>


teman-teman perhatikan



 <ul class=collapsible data-collapsible=accordion>
<li>
<div class=collapsible-header><i class=material-icons>filter_drama</i>First</div>
<div class=collapsible-body><span>Lorem ipsum dolor sit amet.</span></div>
</li>
<li>
<div class=collapsible-header><i class=material-icons>place</i>Second</div>
<div class=collapsible-body><span>Lorem ipsum dolor sit amet.</span></div>
</li>
<li>
<div class=collapsible-header><i class=material-icons>whatshot</i>Third</div>
<div class=collapsible-body><span>Lorem ipsum dolor sit amet.</span></div>
</li>
</ul>


Bagi tampilannya, dan scriptnya seperti ini:



  $(document).ready(function(){
$('.collapsible').collapsible();
});
/**
* Insert your code here
*/


Jadi teman-teman tinggal copy saja dan seperti ini lah hasilnya:



Apa



Dapat di lihat ketika saya mengklik mata uang, karenanya deskripsinya akan muncul di bawah ketika saya klik lagi karenanya akan terturup, lebih rapi dan bagus ya teman-teman oke saya rasa lumayan hingga disini dulu belajar kita mengenai apa itu collapsible dan bagaimana cara membuatnya, hingga berjumpa di artikel berikutnya terimakasih.




Sumber https://kursuswebsite.org

Popular posts from this blog

Perbedaan Antara Keyup dan Keydown Pada jQuery

Membuat Table Warna Berselang dengan PHP