The code above only seems to work for the click on the initial tab
content. After the click you have new content in the tab panel with
perhaps new links that haven't been filtered to direct their clicks
into the tab as well. How do I filter the links in the new incoming
content that is being inserted into the tab? I can't seem to get it
to work. Of course, please correct me if I made a careless mistake,
otherwise any help figuring this out would be greatly appreciated.
var $tabs = $("#messageboxes > ul").tabs();
$tabs.tabs({
load: function(e, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
// At this point we have new content with links that need to be reset
to open in the current tab. How do we do that?
// something like:
$('a', ui.panel).click(function() {
alert('clicked!'); // never happens...
$(ui.panel).load(this.href);
return false;
});
return false;
});
}
On Oct 1, 9:32 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> You need to hijax those links - has been answered quite a few times on
> this already:
>
> S('#foo').tabs({
> load: function(e, ui) {
> $('a', ui.panel).click(function() {
> $(ui.panel).load(this.href);
> return false;
> });
> }
>
> });
>
> Note to self: add to FAQ.
>
> --Klaus
>
> Chris schrieb:
>
>
>
> > Hi,
>
> > I'm using the jQuery UI tabs with ajax page loading.
> > so this kind of code for the tabs
>
> > <div id="example" class="mytabs">
> > <ul>
> > <li><a href="albums1.php">Album1</a></li>
> > <li><a href="albums2.php">Album2</a></li>
> > </ul>
> > </div>
>
> > Let's say that the tab displays pictures. If the user clicks on an
> > image, I would like to open a new php file in the same tab (replacing
> > the old content) displaying the pic and some infos
>
> > How can I do that ?
>
> > Thx
> > Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---