Hello there, I'm pretty new here so forgive me if it is inappropriate
to ask this here.
I've been making a UI for a site, and have been using the UI Tabs
feature to load AJAX tabs. The page is a database of sorts so I was
aiming at using a tabbed interface that loads tabs using ajax. What
I'm trying to do is make it so that clicking a link inside one of
those tabs loads it within the same tab and not navigate away from the
page.
Figuring out how to do that was fairly easy. However, it runs into a
few problems. I'm using the following code to create the tabs.
$('#tabs').tabs({
spinner: 'Loading...',
fx: { opacity: 'toggle', duration: 'fast' },
load: function(event, ui) {
$('a', ui.panel).click(function() {
$(ui.panel).load(this.href);
return false;
});
}
});
What ends up happening though is that it works once... when you click
a link on that tab, it opens up within the tab. It doesn't play an
animation but I figure I can mess with that later. But after
following one link, it doesn't work again, and clicking the link will
navigate the page away from the current location.
I've tried to find information about it and haven't found a whole
lot. I understand that what's missing is that the click event isn't
being binded to links on subsequent page loads. I can't figure out
how to do that though. I tried putting the entire $('a', ui.panel)
block into the callback for the .load, but that only lets me get a
second page before it navigates away. Unfortunately I'm not
experienced enough to find a solution, after a couple hours of
fighting with errors and just plain nothing working, I've given up.
I'd be happy to know if there's anything obvious that I could be doing
to fix this problem. Thanks in advance.
Dan
--
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=.