Category Archives: JS

Dynamic Tabs Subversion Respository

With the help of Cliff, I’ve finally got a publically accessible subversion repository online at http://svn.akrabat.com!

The first project with actual code in it is my Dynamic Javascript Tabs. I’ve updated the trunk to include the change suggested by Samio so that the “activation” code is not part of the js file and is not part of the htm file.

Dynamic JavaScript Tabs v1.0.2

I received a patch from Imobach González Sosa to allow the Dynamic JavaScript Tabs code to support more than one tab container set on a single page.

I’ve applied the patch and this is version 1.0.2!

Thanks Imobach!

Update: I’ve created a separate page to hold the download link

Bug in Dynamic JavaScript Tabs

There’s a bug in the Dynamic JavaScript Tabs code that I wrote. If you have “too many” tabs then they go onto a new line and look really ugly. It’s a CSS issue that I haven’t solved yet..

Anyone out there have any idea why I can’t have 7 tabs? If you do, I’d appreciate a pointer!

Update
I’ve now worked out what it is and I’m being brain dead :) I set the width to 45em!

Dynamic JavaScript Tabs v1.0.1

Using the Dynamic JavaScript Tabs in CMS Made Simple has shown up a small bug if you include the tabs.js file on a page that does not have an element with an id of “tabcontainer”. Hence, I’ve released version 1.0.1 to fix this. No new features have been added.

Update: I’ve created a separate page to hold the download link

Dynamic JavaScript Tabs

This is some code that I wrote to create dynamic tabs. I use it for forms where I have a lot of fields and a good percentage are “advanced” or otherwise not important enough to have visible immediately. The CSS is based on ideas from Silverorange Labs and the JS code is mine. The code is released under the MIT license which basically means you can do what you like with it as long as you don’t blame me!

Basic tutorial

It’s not hard to use and I’ve included a sample html file in the zip archive. The basics are:

<div id="tab-container">
  <div class="tab-content">
      <h1 class="tab" title="title for page 1">Page 1</h1>
      <p>This is the content of tab 1</p>
  </div>
  <div class="tab-content">
      <h1 class="tab" title="title for page 2">Page 2</h1>
      <p>This is the content of tab 2</p>
  </div>
  <div class="tab-content">
      <h1 class="tab" title="title for page 3">Page 3</h1>
      <p>This is the content of tab 3</p>
  </div>
</div>
<script type="text/javascript" src="abs.js"></script>

i.e. you need a “tab-container” and then each tab is contained in a “tab-content” and we use a “tab” to sort out the title. The nice thing is that it degrades really nicely!

Update: I’ve created a separate page to hold the download link