Ajax Tabs

Read more and download "Ajax Tabs"

This workshop we will be building a tabbed content browser that’s Ajax powered. When ever a user clicks a tab the Ajax will communicate with the server and send back the appropriate data for that tab. We will start this workshop off with the XHTML and CSS for the tabbed content browser. We will need 3 main IDs (one for the container, one for the content area and one for the loading status) and 1 class (for the tabs).

The first ID #container will hold the tabs as well as the content area, we only give this a width which everything inside can inherit. The following class .tabs is going to style our tabs, most of the styling we have is mostly for looks an important property is the float:left. The float:left makes the tabs so they are on the same horizontally aligned, this can also be done with using display:inline but with a little more tweaking. We also gave it a property of cursor:pointer so when the user mousses over the tab that it has the look and feel of a button. Finally we have the ID #content.




Visit PhpDaddy.com


Play with this script by changing the html bellow. Submit your changes by clicking on this bar. Refresh the page to reset changes.
Play with this script by changing the html above. Submit your changes by clicking on this bar. Refresh the page to reset changes.

Comment on this example

Name
Url
Comment
Captcha
 

 

1
SPS
2008-04-01 12:29:36
NIce

2
Hamed
2008-03-26 04:12:59
Nice

3
Dream
2008-03-06 05:37:28
Good!

4
Joker
2008-02-25 01:09:16
how to set the script to load every tab on page loading? that will make tab switching instant

5
Andrea
2007-11-28 13:29:35
I'll try it on my blog. Great!!

6
Eric
2007-10-08 22:54:06
dont' support iframe

7
Sachin Jain
2007-09-03 22:35:53
Great script , the only problem i find is the tabs width is not flexible, i have to dynamically generate the tabs and i dont know the width of each tabs ... Any suggestion

8
Sam Stanley
2007-08-19 20:35:22
Seems pretty slow to load the images.

9
Mohsin
2007-07-22 23:24:00
Nice enough

10
Very Goog
2007-07-07 16:38:34
wergtwertye