Easily turn ordered- and unordered HTML list elements into SEO-friendly and accesible TabView-controls that can help save some of your screen-estate.
- Web Design, jQuery
- Showcase, jQuery
- Showcase, Web Design
- Showcase, Web Design, jQuery
- JavaScript, jQuery
- JavaScript, Web Design
- JavaScript, Web Design, jQuery
- JavaScript, Showcase
- JavaScript, Showcase, jQuery
- JavaScript, Showcase, Web Design
- JavaScript, Showcase, Web Design, jQuery
- Development, jQuery
- Development, Web Design
- Development, Web Design, jQuery
- Development, Showcase
- Development, Showcase, jQuery
- Development, Showcase, Web Design
- Development, Showcase, Web Design, jQuery
- Development, JavaScript
- Development, JavaScript, jQuery
- Development, JavaScript, Web Design
- Development, JavaScript, Web Design, jQuery
- Development, JavaScript, Showcase
- Development, JavaScript, Showcase, jQuery
- Development, JavaScript, Showcase, Web Design
- Development, JavaScript, Showcase, Web Design, jQuery
- Andreas Koch, jQuery
- Andreas Koch, Web Design
- Andreas Koch, Web Design, jQuery
- Andreas Koch, Showcase
- Andreas Koch, Showcase, jQuery
- Andreas Koch, Showcase, Web Design
- Andreas Koch, Showcase, Web Design, jQuery
- Andreas Koch, JavaScript
- Andreas Koch, JavaScript, jQuery
- Andreas Koch, JavaScript, Web Design
- Andreas Koch, JavaScript, Web Design, jQuery
- Andreas Koch, JavaScript, Showcase
- Andreas Koch, JavaScript, Showcase, jQuery
- Andreas Koch, JavaScript, Showcase, Web Design
- Andreas Koch, JavaScript, Showcase, Web Design, jQuery
- Andreas Koch, Development
- Andreas Koch, Development, jQuery
- Andreas Koch, Development, Web Design
- Andreas Koch, Development, Web Design, jQuery
- Andreas Koch, Development, Showcase
- Andreas Koch, Development, Showcase, jQuery
- Andreas Koch, Development, Showcase, Web Design
- Andreas Koch, Development, Showcase, Web Design, jQuery
- Andreas Koch, Development, JavaScript
- Andreas Koch, Development, JavaScript, jQuery
- Andreas Koch, Development, JavaScript, Web Design
- Andreas Koch, Development, JavaScript, Web Design, jQuery
- Andreas Koch, Development, JavaScript, Showcase
- Andreas Koch, Development, JavaScript, Showcase, jQuery
- Andreas Koch, Development, JavaScript, Showcase, Web Design
- Andreas Koch, Development, JavaScript, Showcase, Web Design, jQuery
The JavaScript function I developed here easily turns any <ul>...</ul> or <ol>...</ol> list into a simple, SEO-friendly Tab-View control like the one displayed below (↓).
The structure of the underlying HTML and the process of creating the tabbed navigation is still the same as in the previous Prototype-based version – and requires nothing more than a <ul>- or <ol>-list to start with:
<ul title="[TabView Name]">
<li title="[Tab Name 1]"> ... </li>
<li title="[Tab Name 2]"> ... </li>
</ul>
Here is a short video demonstrating how the TabView-control works
and what it is capable of (or see for yourself and play with the demo):
Benefits of the "Simple-jQuery-TabView"
Tab-Views in general are a great way of displaying and structuring big amounts of information using very little of the users' screen-estate,
but it is important that the intention of making your web pages prettier with a TabView-control does not destroy the underlying information-hierarchy:
User-interface requirements may not have any influence on the structure of your web-pages!
You would't put the headline of a Word-document at bottom, just because it looks prettier? Would you? So use Tab-View controls like this one here, that can turn your <ol>...</ol> and <ul>...</ul> lists into a nice and clean Tab-View.
-
SEO-friendly
- Ordered and unordered lists are standard HTML elements for structuring data.
The content of <ol>...</ol> and <ul>...</ul> lists that can easily understood by search-engines and other web-crawlers focusing on the structure and outline of a HTML-page – rather than the look & feel of the information.
- Ordered and unordered lists are standard HTML elements for structuring data.
-
Accessibility
-
Besides search-engines and web-crawlers, ordered and unordered list are also a great way to display information to humans using text-only browsers or screen-readers, because the information is clearly structured.
Increasing the accessibility will also increase your search-engine friendliness; because search-engines work just like humans using screen-readers or text-browser for reading the information on your website:
From the top to the bottom; reading the headline first, then the sub-headline and if they are still interested in what you have to say, they will read the content of that very section. And if you mix up that Find out more about Web Accessibility on the WebAim-Website: http://webaim.org.
-
Besides search-engines and web-crawlers, ordered and unordered list are also a great way to display information to humans using text-only browsers or screen-readers, because the information is clearly structured.
-
Browser-History Support
- The "Simple-jQuery-TabView" implements Ben Alman's Hash-Changed event jQuery-plugin in order to able to react on changed anchor-links.
This enables you to use your browsers' back and forward buttons for navigating through the different tabs of the TabView-control. And this feature allows you or others to set deep-links into the content of your TabView-controls.
- The "Simple-jQuery-TabView" implements Ben Alman's Hash-Changed event jQuery-plugin in order to able to react on changed anchor-links.
-
Lightweight
The jQuery-TabView-control requires nothing more than a small JavaScript file ("tabview.js") and an even smaller CSS file ("tabview.css").
- Uncompressed & Unminified (tabview.js, tabview.css): < 13KB
- Minified (tabview.min.js, tabview.min.css): < 7KB
- With GZIP compression activated it's not even worth mentioning ;-)
-
Easy to implement
When are already using jQuery, you only need to add the JavaScript file "tabview.js" and the Style-Sheets "tabview.css" to your web page:<link href = "tabview.css " rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="tabview.js" type="text/javascript"></script>
<script type="text/javascript">
new TabView($('body>ul:first'));
</script>
Implementation Steps
The implementation is easy as pie:-
Add the Style-Sheets (tabview.css) to the <head>-section of your page:
<head>
<link href="tabview.css" rel="stylesheet" type="text/css" />
</head>
-
Add the following JavaScript-References to the bottom of your page:
<body>
...
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="tabview.js" type="text/javascript"></script>
<script type="text/javascript">
new TabView($('body>ul:first'));
</script>
</body>
Usage
Once you've loaded jQuery and the TabView JavaScript (tabview.js) you can create new TabView instances by passing one or more list elements (using a jQuery-selector) to a new TabView-object:
<ul title="TabView 1">
<li title="Tab 1">Lorem Ipsum</li>
<li title="Tab 2">Semper non lectus</li>
<li title="Tab 3">Dictum at volutpat</li>
</ul>
<script type="text/javascript">
new TabView( $('ul:first') );
</script>
If you like to unload the TabView-control you can do so by simply calling the Destroy()-method:
<script type="text/javascript">
var tabViewControl = new TabView( $('ul:first') );
...
tabViewControl.Destroy() );
</script>
Configuration & Customization
You can customize the look of your TabView-control using these options:
<script type="text/javascript">
new TabView( $( 'selector' ), { width: "500px", activeTextColor: "#FFFFFF", inActiveTextColor: "#000000", activeBackgroundColor: "#243356", inActiveBackgroundColor: "#FFFFFF", enableLog: true });
</script>
Attachments
AndyK-Docs-Simple-jQuery-based-SEO-Friendly-Accessible-TabView-Control-Screenshot-01.png
Screenshot of a Simple-jQuery-TabView control built from a standard HTML ul-list with 3 list elements
tabview.css
The Style-Sheet classes required for displaying the jQuery-TabView-control
tabview.js
The jQuery classes and functions required for creating and rendering the TabView-control
tabview.min.css
The minified version of the Style-Sheet classes required for displaying the jQuery-TabView-control
tabview.min.js
The minified version of the jQuery classes and functions required for creating and rendering the TabView-control
Simple-jQuery-TabView-Demo.html
A demo page showing the SEO-friendly and accessible Simple-jQuery-TabView control in action
AndyK-Docs-Simple-jQuery-based-SEO-Friendly-Accessible-TabView-Control-Video-Implementation.mp4
SEO-friendly, accessible JavaScript TabView-Control: Implementation / The screencast shows how to use and implement the Simple-jQuery-TabView control into a web page.
AndyK-Docs-Simple-jQuery-based-SEO-Friendly-Accessible-TabView-Control-Video-Introduction.mp4
SEO-friendly, accessible JavaScript TabView-Control: Demo / The screencast show how the Simple-jQuery-TabView works and the features it supports.
AndyK-Docs-Simple-jQuery-based-SEO-Friendly-Accessible-TabView-Control-Video-JavaScript-Disabled-Behaviour.mp4
SEO-friendly, accessible JavaScript TabView-Control: Behaviour without JavaScript / The screencast show how the Simple-jQuery-TabView behaves when JavaScript is deactivated.
AndyK-Docs-Simple-jQuery-based-SEO-Friendly-Accessible-TabView-Control-HTML-Structure-01.png
Screenshot of the HTML source: A very basic example of an HTML web page implementing the jQuery-TabView control.
sitemap.xml A-simple-jQuery-Script-for-creating-SEO-friendly-and-accessible-TabView-controls.kml A-simple-jQuery-Script-for-creating-SEO-friendly-and-accessible-TabView-controls.rss A-simple-jQuery-Script-for-creating-SEO-friendly-and-accessible-TabView-controls.xml A-simple-jQuery-Script-for-creating-SEO-friendly-and-accessible-TabView-controls.json A-simple-jQuery-Script-for-creating-SEO-friendly-and-accessible-TabView-controls.print
I'm using this excellent tabview script to improve the interface of my website, but i would like to bind a js function when the user selects a tab. Do you know how i could obtain this?