-
Website
http://20bits.com -
Original page
http://20bits.com/articles/dynamic-ajax-tabs-in-20-lines/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
prissypot13
3 comments · 1 points
-
Felix Purnama
4 comments · 1 points
-
hadley
2 comments · 1 points
-
adamheroku
2 comments · 3 points
-
twiss
2 comments · 1 points
-
-
Popular Threads
But can u suggest , how to get form results output on a particular portion of a page.
Say Left column is a form and right coloumn is for search results for which we will use the form. Then how to get search results using Ajax on the right column. Please help me i am new to this.
Thanks
// If the current tab is set to active, fetch it's content
if ($(id).hasClassName('active')) {
new Ajax.Updater(pane, tabs[id], $H({
asynchronous: true,
method: 'get',
evalScript: true
}).merge(args));
}
This is useful when you want all tabs to be dynamic without a default content but you want one of them to load as default. Example:
First
Second
Third
Fourth
I am trying to integrate a different design to your script, but I need the links to be in .
eg.
Pane 1
But it doesn't work. Why?
Can anyone help?
View source and take it to your hearts content. :)
One question I did have was is it possible to use a Rollover behaviour on the tabs? I want to make the pages load when someone rolls over a tab rather than click.
I copied the necessary styles from the external style sheet. I copied the code in TabbedPane.js to an empty JS file I was using for testing. I copied the source code from to it's closing div tag. And I downloaded pane1.html and pane2.html.
Everything appears to load correctly. But when I click on a tab, the activity indicator, "MyPane_overlay", is not hidden. I placed an alert before the hide function is called, but the alert is never executed. Any ideas why this might fail? Thanks
This system requires at least the prototype.js library. Are you loading both prototype and scriptaculous?
This looks very nice, however I seem to have a problem loading a page when I click a tab link .
the path is correct, and it links to a standard html page, however when I click the tab, it just tries to load but it never does.
So I went to the "activities" window in Safari, to see what has been loaded and it shows that it is trying to load the page. But right next to the file name it says "method not allowed".
Any idea what is causing this?
im just running a test page at the moment, so there is no special scripting or html or anything in the page.
Thanks,
Nice work Jesse!
I'm trying to load some php code into one of the tabs, but it seems like it doesn't support using code in the external file? Can anyone help?
Thanks...
.tabbed-pane * {margin: 0;padding: 0;}
.tabbed-pane {width: 500px;}
.tabbed-pane .tabs {list-style: none;clear: both;float: left;margin-bottom: -1px;}
.tabbed-pane .tabs .active {background: white;border-bottom: 1px solid white;}
.tabbed-pane .tabs li {float: left;margin: 0 3px 0 0;}
.tabbed-pane .tabs li a {color: #336699;display: block;padding: 5px;background: #f0f0f0;border-color: #333;border-style: solid;border-width: 1px;}
.tabbed-pane .pane {border: 1px solid #333;padding: 5px;clear: both;height: 100%;}
.tabbed-container {position: relative;clear: both;min-height: 10em;}
.tabbed-container .overlay {position: absolute;clear: both;border: 1px solid #333;padding: 5px;width: 488px;top: 0;left: 0;background: white url(/include/images/spinner.gif) center center no-repeat;text-align: center;z-index: 100;height: 100%;}
You shouldn't need to muck with the script itself. You can just set the appropriate fields in the <tt>args</tt> parameter — it's passed through to the Updater.
"You can just set the appropriate fields in the args parameter" - I'm new to this and can't do this successfully, whereas including it the script just works.
Thanks,
Jez
Like so:
<pre>new TabbedPane('MyPane',
{
'pane1': '/downloads/pane1.html',
'pane2': '/downloads/pane2.html'
},
{
onClick: function(e) {
$('MyPane_overlay').show();
},
onSuccess: function(e) {
$('MyPane_overlay').hide();
},
evalScripts: true
});</pre>
Thanks!
I'm open to all advice. Do you have any, or are you just complaining miscellaneously?
Can't make head or tails of why. Pity, I kinda liked this solution.
I moved my TabbedPane block to the end of the page just before the tag and it worked fine. Now that I think about it, it makes perfect sense. :)
Now that that's fixed, I'm also experiencing the problem with the overlap pane not being hidden. :(
http://www.prototypejs.org/api/hash/merge
Will post a solution if I find one. Feel free to beat me to it. :)
The problem is that in Prototype 1.6 the hash object is no longer API-compatible with an Object. That means you can't pass in a Prototype Hash where an Object was expected. To remedy this there is no a toObject() method.
I'll post a fix with documentation and the like, but for now you can fix it by adding ".toObject()" after ".merge(args)".
The call to Ajax.Updater should now be <pre>
new Ajax.Updater(pane, tabs[Event.element(e).id], $H({
asynchronous: true,
method: 'get'
}).merge(args).toObject());</pre>