background preloader

Accordion

Facebook Twitter

Flexible Slide-to-top Accordion. In today's tutorial we'll be creating a simple responsive accordion that, when opened, will slide to the top of the viewport and reveal the content by fading it in.

Flexible Slide-to-top Accordion

The idea is to avoid that the user has to scroll the content area into place. We'll also add some nice CSS3 transitions for the arrow to appear and to rotate when we click on an item. The accordion will be flexible, meaning that it will have a liquid width adjusting to the screen size. View demo Download source In today’s tutorial we’ll be creating a simple responsive accordion that, when opened, will slide to the top of the viewport and reveal the content by fading it in. The idea is to avoid that the user has to scroll the content area into place. The beautiful fashion photography is by Rayand; check out his Flickr Photostream. The Markup The HTML structure will consist of a wrapper with the class and ID st-accordion and an unordered list. Let’s take a look at the style. The CSS First, we will style the main wrapper. UI/API/1.8/Accordion. Description: Convert a pair of headers and content panels into an accordion.

UI/API/1.8/Accordion

The markup of your accordion container needs pairs of headers and content panels: Accordions support arbitrary markup, but each content panel must always be the next sibling after its associated header. See the header option for information on how to use custom markup structures. The panels can be activated programmatically by setting the active option. Keyboard interaction When focus is on a header, the following key commands are available: UP/LEFT: Move focus to the previous header.

When focus is in a panel: CTRL + UP: Move focus to associated header. Theming The accordion widget uses the jQuery UI CSS framework to style its look and feel. jQuery UI Accordion. Exactly How to Create a Custom jQuery Accordion. Accordions can be very useful for showing lots of different sections of data in a small amount of space. jQuery UI has a built in Accordion function, but according to the jQuery UI Build your Download, the size of the Core jQuery UI and Accordion scripts are 25kb and 16.6kb, respectively.

Exactly How to Create a Custom jQuery Accordion

Today, I'll show you how to build a custom accordion that is more "bandwidth efficient". That seems like a lot for just one simple accordion. Especially when you add in the normal jQuery script, which is 18kb minified and Gzipped. So instead of increasing your page load time with the extra unneeded functionality, why not create something from scratch? I also think that writing things from scratch really gives you a much better understand of how to use jQuery effectively, without always turning to use someone else’s code. So the plan for this tutorial is to show create an accordion using the jQuery UI function, then create one using some custom coding. The Markup The CSS. Top 20+ jQuery Accordion Tutorials. 27th Nov 2011 | Posted by Eko S. | 2 Comments When you want to present various section of data in a small amount of space, with keep pleasant to readers eyes and not overloaded with extra information then Accordin can be a incredibly useful.

And jQuery is ideal for creating such accordions with the minimal amount of code, clean html and good looking images. In this list article, we’ve collected 10 simple jQuery accordion tutorials that will help you to build your own. Simple jQuery Accordion – Norman's Blog. Wie macht man eigentlich..

Simple jQuery Accordion – Norman's Blog

Habt ihr schon mal eine Seite mit so einem netten Accordion-Effekt gesehen und euch gefragt wie das geht? Ich erkläre es euch, schaut euch doch aber erstmal die Demo an, damit ihr wisst, was ich meine. Wie ihr seht, klappt immer der Bereich auf, auf den geklickt wird. Alle anderen Blöcke bleiben dagegen geschlossen oder schließen sich. Wir bedienen uns hier einfach jQuery und schreiben ein paar Zeilen Code, die den gewünschten Accordion-Effekt realisieren.

HTML-Gerüst Bevor wir anfangen müssen wir unser HTML aber entsprechend vorbereiten.. Jeder dieser Blöcke besteht aus einer Überschrift, die später anklickbar sein wird und einem Container, der den eigentlichen Inhalt des Blocks enthält. jQuery-Code Nun zum eigentlichen Code. Nun zur Erklärung, was da eigentlich abläuft.. Zu 2.: Stichwort – AccessibilityDas Schließen der Container würde auch über CSS (display:none) gehen aber was ist, wenn JavaScript nicht aktiviert ist? Styling per CSS. Accordion. JQuery: Die 20+ besten Content – Plugins (Scroll, Accordion, Slide) » License, Size, Homepage, Demo, JQuery, Accordion » BLOGRAMMIERER. Vor einiger Zeit habe ich ja schon die besten Bildergalerie-Plugins und die besten Modal-Plugins für JQuery vorgestellt und nun soll eine Auflistung der besten Content-Plugins folgen.

JQuery: Die 20+ besten Content – Plugins (Scroll, Accordion, Slide) » License, Size, Homepage, Demo, JQuery, Accordion » BLOGRAMMIERER