Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I Need A Good Accordion

Featured Replies

Hello everyone,

I need to create an accordion on my websites homepage. I have looked around at plugins and open source scripts and there do seem to be quite a few options but all have slight issues with regards to what I'd like to achieve.

Here is a link to what I need to create.

http://www.jackod.com/ofato_blog/Picture%2011.png

Does anyone know of anyone good ways to achieve this or have any links to decent plugins?

Thanks so much in advance.

Regards

Jack

I have done this before, give me an hour or so i will post it up here for you, if no one can help before

Here You Go, you need to change the CSS to make it work how tou want, this is a plugin i found but cant find the link to give them any credit.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style type="text/css">
#accordion {
width: 600px;
list-style: none;
margin: 10px 0;
padding: 0;
height: 200px;
overflow: hidden;
background: #31AEE8;
border: solid 1px #000000;
}
#accordion li {
float: left;
display: block;
height: 170px;
width: 50px;
padding: 15px 0;
overflow: hidden;
color: #fff;
text-decoration: none;
font-size: 16px;
line-height: 1.5em;
border-left: 1px solid #000000;
list-style-position: outside;
}
#accordion li img {
border: none;
border-right: 1px solid #000000;
float: left;
margin: -15px 15px 0 0;
list-style-position: outside;
}
#accordion li.active {
width: 371px;
list-style-position: outside;
}
</style>
<script type="text/javascript">
$(document).ready(function(){

   activeItem = $("#accordion li:nth-child(3)");
   $(activeItem).addClass('active');

   $("#accordion li").hover(function(){
    $(activeItem).animate({width: "50px"}, {duration:1000, queue:false});
    $(this).animate({width: "371px"}, {duration:1000, queue:false});
    activeItem = this;
   });

});
</script>
<ul id="accordion">
 <li> <img src="images/sample1.jpg" alt="sample1"/> <strong>Header 1</strong><br/>
   <p>Text links go here</p>
 </li>
 <li> <img src="images/sample2" alt="sample2" /> <strong>Header 2</strong><br/>
   <p>Text links go here</p>
 </li>
 <li> <img src="images/sample3.jpg" alt="sample3" /> <strong>Header 3</strong><br/>
   <p>Text links go here</p>
 </li>
 <li> <img src="images/sample4.jpg" alt="sample4" /> <strong>Header 4</strong><br/>
   <p>Text links go here</p>
 </li>
 <li> <img src="images/sample5.jpg" alt="sample4" /> <strong>Header 5</strong><br/>
   <p>Text links go here</p>
 </li>
 <li> <img src="images/sample6.jpg" alt="sample" /> <strong>Header 6</strong><br/>
   <p>Text links go here</p>
 </li>
</ul>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.