Membuat Menu Accordion Tanpa Edit HTML. Tampilan menu ini sangat pas dan memberikan kesan indah pada tampalin blog anda, selain itu menu accordion juga memperingkas tampilan blog anda, dengan artian tidak memakn tempat pada sedibar blog anda. Sebagai contoh anda liat sedibar blog ini, amati dengan seksama jiga menurut anda perlu ada di blog anda, berikut cara membuatnya.
1. Masuk ke blog anda
2. Pilih "Tata Letak" kemudian tambah "Gadged" dan pilih "HTML/Java Script"
3. Masukkan kode dibawah ini
<style type="text/css">
#accordion{width:100%;margin:auto;border:0px solid white}
#accordion h2{padding:5px 10px;background-color:#ccc;background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggCAWQtyU5renEMyj_co4f0aZRAVUAk3w9rEVrRiIg3iAd37ilQUGZpuAIUDXjAWRDrMcGlFsq_USgkLTBIQFbgWMQMQVkX6LSrw3s72pcVVe2uK2CTBNx_5h6LuyNz-kQFvmUlEeefuk/s1600/arrow_right.gif);background-repeat: no-repeat;background-position: right center;color:#000;font:normal 11px Tahoma;border-bottom:1px solid #FFF;cursor:pointer;}
#accordion .content{font:normal 11px Arial;padding:5px 10px;background:#eee;}
#accordion .content ul {list-style:none;margin:0 0 0;padding:0 0 0;}
#accordion .content li {background-image: url(); background-repeat: no-repeat;background-position: left center;margin:0;padding:2px 0 3px 0;text-indent:0px;border-bottom:1px dotted #ccc;line-height:1.3em;}
#accordion .content li a:hover {text-decoration:none;color:#000;}
#accordion h2.active{background-color:#bbb;background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vv1tUJhnwy9iRqaTAtLyrSEEw8QXROijyt6CimA4XR0ANEOHxbYpgcyjRPUkI7ZVBv5LT6_VSc899U2-NNxH5UZoBC2nCaR2L8buvDcpD_6VbcEkGQgt8AlRsfMxRmh_K07NdKOzr34/s1600/arrow_down.gif);background-repeat: no-repeat;background-position: right center;font-weight:bold;}
</style>
<script type="text/javascript" src="http://yourjavascript.com/121511228073/accordion-menu.js"></script>
<script type='text/javascript'>
$(function() {
$('#accordion .content').hide();
$('#accordion h2:first').addClass('active').next().slideDown('slow');
$('#accordion h2').click(function() {
if($(this).next().is(':hidden')) {
$('#accordion h2').removeClass('active').next().slideUp('slow');
$(this).toggleClass('active').next().slideDown('slow');
}
});
});
</script>
<div id="accordion">
<h2>Title 1</h2>
<div class="content">
Isi konten 1
</div>
<div id="accordion">
<h2>Title 2</h2>
<div class="content">
Isi konten 2
</div>
<div id="accordion">
<h2>Title 3</h2>
<div class="content">
Isi konten 3
</div>
<div id="accordion">
<h2>Title 4</h2>
<div class="content">
Isi konten 4
</div>
<div id="accordion">
<h2>Title 5</h2>
<div class="content">
Isi konten 5
</div>
</div></div></div></div></div>
#accordion{width:100%;margin:auto;border:0px solid white}
#accordion h2{padding:5px 10px;background-color:#ccc;background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggCAWQtyU5renEMyj_co4f0aZRAVUAk3w9rEVrRiIg3iAd37ilQUGZpuAIUDXjAWRDrMcGlFsq_USgkLTBIQFbgWMQMQVkX6LSrw3s72pcVVe2uK2CTBNx_5h6LuyNz-kQFvmUlEeefuk/s1600/arrow_right.gif);background-repeat: no-repeat;background-position: right center;color:#000;font:normal 11px Tahoma;border-bottom:1px solid #FFF;cursor:pointer;}
#accordion .content{font:normal 11px Arial;padding:5px 10px;background:#eee;}
#accordion .content ul {list-style:none;margin:0 0 0;padding:0 0 0;}
#accordion .content li {background-image: url(); background-repeat: no-repeat;background-position: left center;margin:0;padding:2px 0 3px 0;text-indent:0px;border-bottom:1px dotted #ccc;line-height:1.3em;}
#accordion .content li a:hover {text-decoration:none;color:#000;}
#accordion h2.active{background-color:#bbb;background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-vv1tUJhnwy9iRqaTAtLyrSEEw8QXROijyt6CimA4XR0ANEOHxbYpgcyjRPUkI7ZVBv5LT6_VSc899U2-NNxH5UZoBC2nCaR2L8buvDcpD_6VbcEkGQgt8AlRsfMxRmh_K07NdKOzr34/s1600/arrow_down.gif);background-repeat: no-repeat;background-position: right center;font-weight:bold;}
</style>
<script type="text/javascript" src="http://yourjavascript.com/121511228073/accordion-menu.js"></script>
<script type='text/javascript'>
$(function() {
$('#accordion .content').hide();
$('#accordion h2:first').addClass('active').next().slideDown('slow');
$('#accordion h2').click(function() {
if($(this).next().is(':hidden')) {
$('#accordion h2').removeClass('active').next().slideUp('slow');
$(this).toggleClass('active').next().slideDown('slow');
}
});
});
</script>
<div id="accordion">
<h2>Title 1</h2>
<div class="content">
Isi konten 1
</div>
<div id="accordion">
<h2>Title 2</h2>
<div class="content">
Isi konten 2
</div>
<div id="accordion">
<h2>Title 3</h2>
<div class="content">
Isi konten 3
</div>
<div id="accordion">
<h2>Title 4</h2>
<div class="content">
Isi konten 4
</div>
<div id="accordion">
<h2>Title 5</h2>
<div class="content">
Isi konten 5
</div>
</div></div></div></div></div>
4. Isikan Konten 1-5 sesuai kebutuhan anda.
5. Klik save dan lihat hasilnya.!
Sumber: http://www.maskolis.com/2012/12/membuat-menu-accordion-tanpa-edit-html.html
0 komentar:
Posting Komentar