Directions
Step 1: Under the Layout > Edit HTML tab - insert the following section code below right before the closing head tag – </head>
<link href='haccordion/haccordion.css' rel='stylesheet' type='text/css'/>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script src='haccordion.js' type='text/javascript'>
</script>
<style type='text/css'>
/*CSS for example Accordion #hc1*/
#hc1 li{
margin:0 3px 0 0; /*Spacing between each LI container*/
}
#hc1 li .hpanel{
padding: 5px; /*Padding inside each content*/
background: lightblue;
}
/*CSS for example Accordion #hc2*/
#hc2 li{
margin:0 0 0 0; /*Spacing between each LI container*/
border: 12px solid black;
}
#hc2 li .hpanel{
padding: 5px; /*Padding inside each content*/
background: #E2E9FF;
cursor: hand;
cursor: pointer;
}
</style>
<script type='text/javascript'>
haccordion.setup({
accordionid: 'hc1', //main accordion div id
paneldimensions: {peekw:'50px', fullw:'400px', h:'158px'},
selectedli: [0, true], //[selectedli_index, persiststate_bool]
collapsecurrent: false //
})
haccordion.setup({
accordionid: 'hc2', //main accordion div id
paneldimensions: {peekw:'30px', fullw:'450px', h:'150px'},
selectedli: [-1, true], //[selectedli_index, persiststate_bool]
collapsecurrent: true //
})
</script>
Note: The code above references 2 external .js files and an image, which you need to download below (right click/ select “Save As”)
Step 2: Navigate over to Layout > Page Elements to add an HTML/JavaScript gadget. Copy and paste the following section code below in the box and select save.
Demo 1 -
<h2>Demo 1:</h2>
<div id="hc1" class="haccordion">
<ul>
<li>
<div class="hpanel">
<img style="float:left; padding-right:8px; width:200px; height:148px" src="mail_receive.png"/>subscribe by email to blogspot vision to receive daily updates, free ebooks, and notice of upcoming contests
</div>
</li>
<li>
<div class="hpanel">
<img style="float:left; padding-right:8px; width:200px; height:148px" src="facebook.png"/>connect with us on facebook for website updates and interact with other bloggers around the world
</div>
</li>
<li>
<div class="hpanel">
<img style="float:left; padding-right:8px; width:200px; height:148px" src="twitter.png"/>connect with us on twitter for bite sized updates and other promotions
</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> </p>
Demo 2 -
<h2>Demo 2:</h2>
<div id="hc2" class="haccordion">
<ul>
<li style="border-right-width:0">
<div style="padding:10px; width:250px" class="hpanel">
subscribe by email to blogspot vision to receive daily updates, free ebooks, and notice of upcoming contests
</div>
</li>
<li style="border-right-width:0">
<div style="padding:10px; width:180px" class="hpanel">
connect with us on twitter for bite sized updates and other promotions
</div>
</li>
<li style="border-right-width:0">
<div style="padding:10px; width:350px" class="hpanel">
connect with us on twitter for bite sized updates and other promotions
</div>
</li>
</ul>
</div>
*Tutorial completed
Source: Dynamic Drive – dhtml scripts for the real world