SimpleTabs - Unobtrusive Tabs + Ajax (v1.0)

Small, simple and unobtrusive Tab plugin for MooTools including support for Ajax content. Overlays semantic XHTML markup with a tabbed interface without additional changes. Customise the style and behaviour by changing the simplified CSS or via various custom Events.


Showcases

Features

  • Unobtrusive behaviour, visitors with disabled JavaScript or old browsers can still navigate through your content.
  • Simplified CSS and XHTML and behaviour-controlled CSS classes for complete styling control via sliding-doors or similar techniques.
  • Generates tabs from existing XHTML structure by replacing that content.
  • Requests and caches Ajax content on demand.

How to use

// Wait for the content ...
window.addEvent('domready', {
 
    var container = $('my-tabs')
 
    new SimpleTabs(container, {
        selector: '.header' // every element with class .header is removed and added as tab
    });
 
});

Compatibility

Fully compatible with all A-Grade Browsers (Internet Explorer 6+, Opera 9, Firefox 1.5+ and Safari 2+)

Requirements

MooTools JavaScript Framework

Download MooTools 1.2 with at least these modules:

  • Fx.Tween
  • Selectors
  • Request.HTML
  • DomReady (facultative)

Download

Changelog

1.1 (2008-05-07)

Public release for MooTools 1.2 - Support for static content and Ajax requests - Simplified CSS and span’s to allow styling with sliding doors technique - Reads tab content from existing XHTML markup

License

All files are © 2008-2009 by Harald Kirschner and available under the MIT License.

Contact & Discussion

For asking questions, requesting features, filing bugs or contributing other thoughts on this project use the support forum below. Before posting a new question, read through the documentation and the contributed notes for an answer. For problem reports make sure to add enough details like browser, version and a link or the relevant code.

You can contact me for non-support related notes.

Professional Support

I am available for hire if you look for professional and swift help. I can come to your rescue for installation, customization or extending the existing source for your needs.

Share it: Stumble it!Digg This!del.icio.us (33 Posts: )

discussion by DISQUS 39 Comments

Please use the support forums for discussing the project, asking questions or posting bug-fixes!

Sort:
Comments 1 – 20 of 39:
  • reply
    Avatar
    Dr.
    said 2 years ago (2 Points)
    excuse me, made a mistake. I would like to create div (non refreshing by ajax) in tab-wrapper along with ul.tab-menu and div.tab-wrapper.
  • reply
    Avatar
    Dr.
    said 2 years ago (2 Points)
    hello! first of all - thank you for your work you're sharing!

    I'm trying to make some changes to this plugin. I want to make one more div inside of tab-content, but can't do that. Is there any chance you can help me with that?

    thank you!
  • reply
    Avatar
    erikvar 1 Point
    said 1 year ago (1 Point)
    Hello Harald,
    I'm trying to implement your really nice Showcase “Ajaxified Tabs” with Slideshow2 and i have some trouble cause Slideshow2 use also the mootools core but don't have all the function. So when i tried to load a second time the mootools core with the functions requested for you Showcase Ajaxified Tabs i got bug on the Showcase, it doesn't load the html file...
    Can you please help me?
    Thanks in advance,
    Erik
  • reply
    Avatar
    colin
    said 1 year ago (1 Point)
    Hi

    Great little plug in for Mootools.

    Does it support flash within the tabbed area? The flash appears ok if I load the page by itself but within a tab I just get the background of the div container. If I remove the div nothing appears.

    Cheers

    Colin
    Isle of Man (UK)
  • reply
    Avatar
    colin
    replied 1 year ago (1 Point)
    Hi

    Not to worry, I went back to the original <object <br="" and="" classid...="" for="" not="" now.="" only="" runactivecontent="" script="" the="" using="">
    Thx

    Colin</object>
  • reply
    Avatar
    JR
    said 1 year ago (1 Point)
    Hi
    I'me Testing SimpleTabs and did not find how to set a default Selected item using Server Side Code. Can you help?
  • reply
    Avatar
    Marko
    said 1 year ago (1 Point)
    Hi
    I have the same question like Mike (6 monts ago)

    Putting two sets of basic tabs into one page?

    Please help.
    Thanx
  • reply
    Avatar
    Marko
    replied 1 year ago (1 Point)
    Solved
    Just rename the tab and selector
    new SimpleTabs('', {
    selector: 'h2'
  • reply
    Avatar
    Daniel Sturm
    said 1 year ago (1 Point)
    Hi! Thanks for your script, it's just what I needed! I've only added support for preselction of tabs by url: http://paste.mootools.net/f3bc6d040
  • reply
    Avatar
    perrohunter 1 Point
    replied 1 year ago (1 Point)
    impresive
  • reply
    Avatar
    Sam
    said 1 year ago (1 Point)
    How to make the browser remember which Tab is selected:

    [+Add to very top of the code]:
    var selectedTab = Cookie.read('selectedTab');
    if (!selectedTab) { selectedTab = 0; }

    [+Add to Line 120]:
    var cookie = Cookie.write('selectedTab', index, {duration: 30});

    [=Change (Line 23)]:
    show: 0,

    [To this]:
    show: selectedTab,
  • reply
    Avatar
    seb
    said 1 year ago (1 Point)
    for my css design i need to specify last element.
    is it possible ?
    thanks
  • reply
    Avatar
    said 1 year ago (1 Point)
    Let me start by saying that I love this script! I've implemented it here: http://www.ridebooker.com/book/airports/yvr/whistler/whistler-shuttle

    Could anyone please give a hint as to how I could open a tab using a text link on the page that is outside the tab?
  • reply
    Avatar
    Mark
    replied 1 year ago (1 Point)
    Hello Casey, did you find a way to open a tab from a text link in another tab? I'm having the same problem..

    Thanks a lot!
  • reply
    Avatar
    jim
    said 1 year ago (1 Point)
    Hi, would it be possible to mix the tabs, ie to have one tab retrieved via ajax and one by inline code?
    Thanks!
  • reply
    Avatar
    jiri 1 Point
    said 1 year ago (1 Point)
    Hi, first of all: nice work and great site!

    I was wondering whether anyone could give me an idea about the following:

    I've tested the SimpleTabs component and it works well (one page and using the 'domready' functionality.

    When I try to use mootools/ajax to dynamically load parts of a webpage based on the users selections, I can't get the tabs to be "formed/recognized" anymore. Is there a way I can invoke the process to form the tabs?

    Regards
    Jiri



  • reply
    Avatar
    Hugo
    replied 1 year ago (1 Point)
    Have you found a solution yet? I'm looking foe help for the same kind of issue. Thanks!
  • reply
    Avatar
    Rob V
    said 1 year ago (1 Point)
    Is there anyway to select which tab is active on the load?
  • reply
    Avatar
    waitangi 1 Point
    said 1 year ago (1 Point)
    Is there any way to get the tabs to load 'tabbed'? Currently it seems that the content all loads and then gets tabbed a few seconds later.

  • reply
    Avatar
    russell 1 Point
    said 1 year ago (1 Point)
    i seem to have an issue with google maps being off-centred when in a 2nd-or-higher tab in mac firefox 3...
    demo:
    http://www.splitlife.com/maps

    Any ideas? Thanks for the great scripts btw
Comments 1 – 20 of 39:

Post your comment

Please use the support forums for discussing the project, asking questions or posting bug-fixes!


Internet Consultant & Contractor

I'm available to combine forces with you and your team to find the most simple, elegant and convenient web solutions . I await your call.

If you just like my work and want to say Thank You, donate via PayPal or Amazon Wish List.

Developer Resources & Tools