Cara Membuat Horizontal Accordion | Buku Catatan si Ugi

Daftar UL (UL list) sebenarnya dapat menjadi sebuah konten serbaguna, salah satunya accordeon horizontal. Disini dimana saat anda menggerakan mouse diatas sebuah LI, maka expand dapat dilakukan untuk menampilkan sebuah konten horizontal, baik berupa gambar, text atau file eksternal dan mengambilnya melalui ajax.



Demo 1:

  • The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.

  • Japan is a constitutional monarchy where the power of the Emperor is very limited.

  • Agriculture has long been the most important sector of the Cambodian economy.



Demo 2:

  • This accordion content has a custom full width of 250px. Note where the two inline CSS are added within the markup.

  • This accordion content has a custom full width of 180px. Note where the two inline CSS are added within the markup.

  • This accordion content has a custom full width of 350px. Note where the two inline CSS are added within the markup.


Cara Memasang Horizontal Accordion

Langkah Pertama:
Tambahkan kode script berikut ini pada halaman anda tepat diatas kode </head>.

<link href='http://caprt3a.fileave.com/HorizontalAccordion/haccordion.css' rel='stylesheet' type='text/css'/>
<script src='http://caprt3a.fileave.com/HorizontalAccordion/haccordion.js' type='text/javascript'>

/***********************************************
* Horizontal Accordion script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>


<script type="text/javascript">
//<![CDATA[
haccordion.setup({
accordionid: 'hc1', //main accordion div id
paneldimensions: {peekw:'50px', fullw:'400px', h:'158px'},
selectedli: [0, true], //[selectedli_index, persiststate_bool]
collapsecurrent: false //<- No comma following very last setting!
})

haccordion.setup({
accordionid: 'hc2', //main accordion div id
paneldimensions: {peekw:'30px', fullw:'450px', h:'150px'},
selectedli: [-1, true], //[selectedli_index, persiststate_bool]
collapsecurrent: true //<- No comma following very last setting!
})

//]]></script>


Langkah Kedua:
Pasang script contoh berikut ini untuk membuat Horizontal Accordion, letakan pada <body> halaman site anda.

<h2>Demo 1:</h2>

<div id="hc1" class="haccordion">
<ul>

<li>
<div class="hpanel">
<img src="http://img502.imageshack.us/img502/746/thailand.jpg" style="float:left; padding-right:8px; width:200px; height:148px" />The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.
</div>
</li>

<li>
<div class="hpanel">
<img src="http://img264.imageshack.us/img264/7199/japan.jpg" style="float:left; padding-right:8px; width:200px; height:148px" />Japan is a constitutional monarchy where the power of the Emperor is very limited.
</div>
</li>

<li>
<div class="hpanel">
<img src="http://img101.imageshack.us/img101/516/mayai.jpg" style="float:left; padding-right:8px; width:200px; height:148px" />Malaysia is a South Asian country rich in natural resources in areas such as agriculture, forestry and minerals.
</div>
</li>

<li>
<div class="hpanel">
<img src="http://img194.imageshack.us/img194/9553/camam.jpg" style="float:left; padding-right:8px; width:200px; height:148px" />Agriculture has long been the most important sector of the Cambodian economy.
</div>
</li>

<li>
<div class="hpanel">
<img src="http://img408.imageshack.us/img408/5751/langkawi.jpg" style="float:left; padding-right:8px; width:200px; height:148px" />Langkawi is particularly known for its beaches which are among the best in Malaysia.
</div>
</li>

</ul>
</div>

<p style="clear:left"><a href="javascript:haccordion.expandli('hc1', 0)">Expand 1 Panel</a> | <a href="javascript:haccordion.expandli('hc1', 1)">Expand 2nd Panel</a> | <a href="javascript:haccordion.expandli('hc1', 2)">Expand 3rd Panel</a> | <a href="javascript:haccordion.expandli('hc1', 3)">Expand 4th Panel</a> | <a href="javascript:haccordion.expandli('hc1', 4)">Expand 5th Panel</a></p>

<br />

<h2>Demo 2:</h2>

<div id="hc2" class="haccordion">
<ul>

<li style="border-right-width:0">
<div class="hpanel" style="padding:10px; width:250px">
This accordion content has a custom full width of 250px. Note where the two inline CSS are added within the markup.
</div>
</li>

<li style="border-right-width:0">
<div class="hpanel" style="padding:10px; width:180px">
This accordion content has a custom full width of 180px. Note where the two inline CSS are added within the markup.
</div>
</li>

<li style="border-right-width:0">
<div class="hpanel" style="padding:10px; width:350px">
This accordion content has a custom full width of 350px. Note where the two inline CSS are added within the markup.
</div>
</li>

<li>
<div class="hpanel" style="padding:10px; width:550px">
This accordion content has a custom full width of 550px. Note where the two inline CSS are added within the markup.
</div>
</li>

</ul>
</div>

sumber: dynamicdrive




0 komentar:

Post a Comment



Catatan :

Untuk menyisipkan gambar kedalam komentar, gunakan tag : [img]URL_Gambar[/img]
atau <i rel="image">URL_Gambar</i>
Untuk Video Youtube : [youtube]URL_Video[/youtube]
atau <i rel="youtube">URL_Video</i>
Untuk "Kutipan", gunakan : [blockquote]Kutipan_Anda[/blockquote]
atau <b rel="quote">Kutipan_Anda</b>
Untuk menyisipkan Kode: [code]KODE[/code]
atau <i rel="code">KODE</i>
atau <i rel="pre">KODE</i>
Dan untuk menyisipkan smiles/ emoticon, lihat kode Emoticon







 

Anda sudah mengaktifkan penyaringan konten ( AdBlocker di Aktifkan )

Mohon maaf untuk sementara Anda tidak dapat melihat halaman ini, silahkan kembali lagi setelah Anda menonaktifkan filter yang Anda gunakan. Abaikan