I've managed to modify the tabs code to allow you to send a new URL to
the tab to be executed. Here's a diff:

Compare: (<)Original\jquery.tabs.js
   with: (>)Modified\jquery.tabs.js

356c358,362
<             // if the tab is already selected or disabled or
animation is still running stop here
---
>                       var tgt = arguments[1] || false;
>
>             // if the tab is already selected or disabled or animation is 
> still running stop here
>                       if( !tgt )
>                       {
361a367
>             }
387c394
<                     $(this).trigger('click');
---
>                     !tgt ? $(this).trigger('click') : 
> $(this).trigger('click', [tgt]) ;
427a434,435
>                       var tgt = arguments[1] || false;
>
430,435c439,452
<             // if onClick returns false, the tab is already selected
or disabled or animation is still running stop here
<             if ((typeof onClick == 'function' && onClick(this,
toShow[0], toHide[0]) == false && trueClick) ||
<                 container.locked || li.is('.' +
settings.selectedClass) || li.is('.' + settings.disabledClass)) {
<                 this.blur();
<                 return false;
<             }
---
>             if( !tgt )
>             // if we've not passed a new target
>                       {
>                               // if onClick returns false, the tab is already 
> selected or disabled or animation is still running stop here
>                               if ((typeof onClick == 'function' && 
> onClick(this, toShow[0], toHide[0]) == false && trueClick) ||
>                                       container.locked || li.is('.' + 
> settings.selectedClass) || li.is('.' + settings.disabledClass)) {
>                                       this.blur();
>                                       return false;
>                               }
>                       }
>                       else
>                       {
>                               remoteUrls[clicked.hash] = tgt;
>                       }
589c606
<         return function(tab) {
---
>         return function(tab, tgt) {
599c616
<                 a.trigger(tabEvent);
---
>                 a.trigger(tabEvent, [tgt]);

To use:
$('#tabs').triggerTab(2, 'http://mysite.com/mypage.html');

One benefit is that the tab remembers its new target, so when its
clicked you get the same page again, rather than the one set by
default.

Its probably a terrible hack, but it works for now. I hope you decide
to add this feature in your next release, its extremely useful.

HTH
Phill
--


On Apr 18, 3:28 pm, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> Phillip B Oldham schrieb:
>
> > I'd like to be able totriggeratabusing the following format (or
> > something similar):
>
> > $('#container').triggerTab(3, 'http://mysite.com/updates.html');
>
> > The second parameter is aURLI'd like toload, which can change
> > depending on user input.
>
> > Is this possible?
>
> No it isn't. RemotetabURLs are static so far...
>
> -- Klaus

Reply via email to