A new Version of the free EasyTabs Script is available. You can now set a autochange modus to one of your menus. Accessible compact and compatible with all browsers as always.

Examples

Here are three basic examples:

Basic Infos and Features

  • Free for private and commercial projects
  • successfully tested in IE5.0, IE5.5, IE6, IE7, Firefox 2, Opera 9.2
  • if Javascript is disabled – all contentboxes are visible
  • you can navigate between the tabs with the keyboard TAB Key
  • you can easy define which Tab shoud be active @ start
  • you can easy add as much tabmenus as you want on one site
  • If you want that the tabs are changing on click and not on mouseover -> then just change the onmouseover to onclick
  • Of course you can set a link to each Menu Tab – just set the linkurl in the href and delete the onclick=”return false”
  • In the Examples i’ve packed everything (Html, CSS, Javascript) in 1 File – but you can also put the css in an external css file and the javascript in an external javascript file. I’ve included one clean example in the Download Zip File below.

Code Explanation

There are 3 new Settings you can set in the javascript

//Set the number of your menu which should autochange
var autochangemenu = 1;
//Set the speed in seconds when tabs should change
var changespeed = 3;
//should the autochange stop if the user hover over a tab from the autochangemenu? 0=no 1=yes
var stoponhover = 0;

I hope this Tab Menu is useful for you, if you have questions or improvements please post a comment, thank you.

Download EasyTabs 1.2 Example Package

  Easy Tabs 1.2 (9,9 KiB, 572.749 hits)

Previous Versions of Easy Tabs

EasyTabs 1.1 (Infos here)

  Easy Tabs 1.1 (7,0 KiB, 12.846 hits)

EasyTabs 1.0 (Infos here)

  Easy Tabs 1.0 (1,2 KiB, 11.300 hits)

Joomla Plugin JooTabs by Ricardo Sousa und Andy Sikumbang

  1. John Stevens schreibt:

    [qoute]

    The tabs are loading on “onload” so the tabs are just showing up after the full page was loaded.
    You could use jQuery and the $(document).ready(function(){}); to avoid this – like i do on my page.

    [/qoute]

    Could you please give an example (it doesn’t work for me yet.

    here’s what I have:

    window.onload=function(){
    var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]); a++; b++;}while (b<=menucount);
    if (autochangemenu!=0){start_autochange();}
    }

    thanks in advance!

  2. Hi John,
    forget the window.onload=function

    include the jquery library and use:

    $(document).ready(function(){
    var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]); a++; b++;}while (b<=menucount);
    if (autochangemenu!=0){start_autochange();}
    });

  3. sakalli schreibt:

    hi, thanks for this! i changed the onmouseover to onclick, i.e.:
    bla bla

    otherwise works ok but everytime i click on a tab the page jumps up to top position. any clues how to fix this?

    cheers!

  4. sakalli schreibt:

    sorry the bla bla vas supposed to be a sample of the code. ill try once more without the tags:

    onmouseover=”return false;” onfocus=”return false;” onclick=”easytabs(‘2’, ‘1’);” title=”” id=”tablink2_1″

  5. Hey,
    How can I link to a specific tabcontent from another page?
    e.g a href=newpage.html#tabcontent2 to display content from the 2nd tab.

    I have tried using the tags #tablink2 and #tabcontent2 – tablink does select the correct tab ‘link’ but still doesn’t seem to click it to show the content..

    i’d like to be able to link directly to specific tabs from another page if possible, so once clicked it will load that page and the tab content i specified in the url string, how can I do this?

    I checked all comments and documentation and i’m scratching my head =p

  6. securitywonks schreibt:

    thank you for the nice script. I observed one little issue, i.e. page moving to the top, when a tab is clicked (onclick mode) or mouseovered (onmouseover mode).

    this is troubling when we place the tabed content in the middle or bottom of the page. thank you.

    overall, this is nice work, I hope you will fix this, thank you

  7. securitywonks schreibt:

    when we use onclick mode, how it will be to automatically initiate STOP autochange until a page reload or until the user clicks on restart (if stopped) link kind of, just some thoughts, thank you

  8. securitywonks schreibt:

    enabling var stoponhover = 1; in settings when using onclick mode helps to have autochange disabled in that event either until page is refreshed or restart (if stopped) link is clicked upon.

    coming to the [Stop the Change] and [Restart (if stopped)] links, when they are clicked, again the browser moves to the top. The solution is simple again, just replace “onmousedown” with “onclick”, it just works 🙂

    thank you for the nice script 🙂

  9. Hello, is it possibile to return (after X seconds) to the active tag chosen with JS even if the user try to navigate through the tabs?

  10. why there’s some space between first tab with the second tab when i change the border of the tab with other color than the background?

  11. @Edduard
    it’s works 4 me. i added a table outside the tabs and also inside the tabs body ( content ). but there some bug when i view it in IE, but it runs normal in FF or opera. there a space between the tabs with the tab’s body. then, after a change it with table, the space’s is gone. i don’t know if something’s wierd with those css, but what i can make sure is, that i lack knowledge about how css runs in IE.

  12. Hi, this tabs are great code, and i’m using this for my site, on question, where do i can change color font on the each tabs! I’m trying to find out where to change color font from default light gray on the tabs to other color, i could not figure out where to change that.

    please let me know thanks.

    AM

  13. For use on a Sharepoint page (as in a Web Part or in an ItemStyle XSL template) the OnLoad statement will interfere with other page content scripts. Instead, change the OnLoad into a function and push the name to Sharepoint.

    E.g. change this

    window.onload=function(){
    var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]); a++; b++;}while (b<=menucount); if (autochangemenu!=0){start_autochange();}}

    to

    function startEasyTabs(){
    var menucount=loadtabs.length; var a = 0; var b = 1; do {easytabs(b, loadtabs[a]); a++; b++;}while (b<=menucount); if (autochangemenu!=0){start_autochange();}
    }
    _spBodyOnLoadFunctionNames.push('startEasyTabs');

    Cheers!

  14. Valuable news and excellent sketch you got here! I would like to thank you against sharing your thoughts and occasion into the poppycock you collection!! Thumbs up

  15. Flory schreibt:

    Hello,

    I set 2 tabmenu, one for the featured post (this works fine) and one to display Website info in home page and in single post (this doesn’t work).

    If I view it in home page it works fine, but if I view it in a single post it doesn’t hide all the tabs except the clicked one.

    Is this a bug?
    Please help me.
    Thank you.

  16. Belle schreibt:

    Hi,
    Great work thanks for sharing! Any chance you’d share the script for the Tab Menu you have in this page which includes the Print, Email and PDF version options?
    Thanks again!!

  17. Jenell schreibt:

    Hi- Great script..

    I have it loaded and it works However content from all tabs appear when the page is first loaded. When I mouse over any tab – then the content from just that tab appears…. but on initial page load all content from all tans appears on one page.

    This site isnt live yet so I cant provide an example url- but hoping you have an idea based on my description ?? please help

    and thanks so much

    Jenell

  18. Flory schreibt:

    @ Jonell:
    I have your same problem.
    I solved simply using another script: jQuery UI.

    Now with just one line I can make tabs with a lot of visual effects (rotate, slide, etc.).
    Furthermore, jQuery is compatible with all existing browsers.

    http://jqueryui.com/demos/tabs/

  19. Ryann schreibt:

    Is it possible to dynamically set var loadtabs? I’d like a different tab to be default depending on which page is loaded. I believe I may be able to read a session variable in javascript by writing it to a hidden text box. Any help on how to do this would be appreciated. Thanks in advance.

  20. Mathias schreibt:

    How does it come that, when i open my website that the comment
    boxes of the differtent tabs are underneed each other…

    I you open the site i want that only the comment box of tab1 is viseble.

    How should i do that ?

  21. Do you have a link for me Mathias?

    @Ryann – You can do this with php: if ($page ==”news”) {echo “1”;} else if ($page==”archiv”) {echo “2”;}
    just echo the value in the line: var loadtabs = new Array(“”)

  22. This worked perfectly for me. I run a joomla website and some times adding more functions or another jquery file can lead to conflicts. This is old school but it worked like a charm. Thank You!!!

  23. Hi – this is not actually my site but I am trying to help the owner with a persistent problem. When a page loads the menu is expanded until I mouse over a menu/tab item, when it contracts. How can I get this behaviour to stop or at least correct itself automatically?

  24. I seem to have a conflict with mootools library… has anyone figured out how to fix it?
    AutoTab works in FF both pc and mac, but none others with autoTab on.

  25. Thanks for your nice work. Now, the content is displayed when I move the mouse on a tab. What should I do if I want to read the content by clicking a tab rather than moving the mouse on a tab? Thanks.

  26. Ramona schreibt:

    Hi there, great script, thanks for providing it. I would like to use the one tabmenu for a project. Wondering how I could make one menu, but two (or more, possibly) rows in the menu. Again, don’t need a separate menu, because I want the content for all the tabs to display in the same place. However, it’s going to be a menu with about 10 items in it, and there won’t be enough room on most screens for it to be entirely within one horizontal line.

    Or, do I just keep adding items, and perhaps they’ll wrap? Is that supposed to be the strategy here? Thanks for any feedback!

  27. Ramona schreibt:

    Er, I just experimented a bit, and I don’t think they’re going to wrap automatically. At least, in Safari, they certainly don’t seem to be.

    Can anyone tell me how to accomplish wrapping / additional rows? Thanks!

  28. techpaul schreibt:

    Thought about using it, gave up as soon as I saw typical CSS madness.

    FONTS are measured in POINTS and EMS not pixels. Points will rescale whatever the screen resolution and size. Measurements in pixels are for graphic items images, lines, tiny paddings.

    Font related heights should be in points, widths should be in EMS or ENS.
    General widths should be in PERCENTAGE so it scales with window size/resolution/ screen size.

    As soon as you measure everything in pixels it ONLY works on ONE screen size and resolution

  29. I’m not sure why but this site is loading extremely slow for me.
    Is anyone else having this issue or is it a problem on my end?
    I’ll check back later on and see if the problem still exists.

  30. Today, I went to the beachfront with my children. I found a
    sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put
    the shell to her ear and screamed. There was a hermit crab inside and
    it pinched her ear. She never wants to go back! LoL I know this is totally off topic but I had to tell
    someone!

  31. Vincent schreibt:

    Hello Juergen,

    I love your tabs and would like to use them on my website. However I run into a problem and I can’t figure out what I am doing wrong. I changed onmouseover to onclick but when clicking on a tab, the page jumps back to the top (the tab opens correctly though). Any idea how I can fix it?

    Thanks in advance.

  32. I usually do not write a comment, but I looked at through some responses here Easy Tabs 1.2 –
    now with autochange | Kollermedia.at. I do have a few questions
    for you if it’s okay. Could it be simply me or do some of these
    remarks look as if they are written by brain dead people?
    😛 And, if you are posting on additional places, I would like to
    keep up with everything new you have to post. Would you list of all of your social sites like your
    Facebook page, twitter feed, or linkedin profile?