You're simply selecting too much... The selector "#container-1 ul"
matches *all* uls inside container, thus applying the selected option
to all of course. You probably want to to use "#container-1 > ul".

--Klaus


On 26 Okt., 10:19, Narinder <[EMAIL PROTECTED]> wrote:
> Hi,
>
>            I am using jquery tabs in my application and it is great to
> see the community support so far. I am trying to preselect a known tab
> using "selected" option as shown below. The value currMainTab is a
> variable that gets set by each of the pages that gets loaded in tabs
> (not via ajax). The problem I am running into is that the selected
> option also affects my sub tabs which I want to avoid. As an example
> if I set my currMainTab value to 6 which is supposed to select
> <li><a href="#fragment-7"><span>My Account</span></a></li> tab, which
> it does fine but then it tries to set the same selection on the sub
> tabs also and my sub tab row doesn't happen to have that many tabs in
> it.
>
> <script type="text/javascript">
>    $(document).ready(function() {
>         $('#container-1 ul').tabs({
>             selected: currMainTab,
>             select: function(e, ui) {
>                 if(ui.tab.hash.indexOf('fragment') < 0){
>                     var url = ui.tab.hash.substring(1);
>                     document.location = url;
>
>                     return false;
>                 }else{
>                     return true;
>                 }
>             }
>         }).show();
>     });
>
> </script>
>
> <div id="container-1">
>     <ul>
>         <li><a href="#fragment-1"><span>Listings</span></a></li>
>         <li><a href="#fragment-2"><span>Images</span></a></li>
>         <li><a href="#fragment-3"><span>Feedbacks</span></a></li>
>         <li><a href="#fragment-4"><span>Messages</span></a></li>
>         <li><a href="#fragment-5"><span>Reports</span></a></li>
>         <li><a href="#fragment-6"><span>Shipments</span></a></li>
>         <li><a href="#fragment-7"><span>My Account</span></a></li>
>     </ul>
>         <div id="fragment-1">
>              <ul>
>                 <li><a href="#fragment-1c"><span></span></a></li>
>                 <li><a href="#ListingEditAction.do?
> action=new"><span>Create Listing</span></a></li>
>                 <li><a href="#ListingEditAction.do?
> action=new"><span>Create Template</span></a></li>
>                 <li><a href="#ViewListingAction.do?
> action=pending"><span>Pending Listings</span></a></li>
>                 <li><a href="#ViewListingAction.do?
> action=listed"><span>Active Listings</span></a></li>
>                 <li><a href="#ViewListingAction.do?
> action=sold"><span>Sold Listings</span></a></li>
>                 <li><a href="#ViewListingAction.do?
> action=unsold"><span>Unsold Listings</span></a></li>
>                 <li><a href="#ViewListingAction.do?
> action=archived"><span>Archived Listings</span></a></li>
>             </ul>
>         </div>
>         <div id="fragment-2">
>              <ul>
>                 <li><a href="#fragment-2a"><span></span></a></li>
>                 <li><a href="#imageLoader.jsp"><span>Upload</span></
> a></li>
>                 <li><a href="#ViewImagesAction.do?
> action=viewListingImage&menu=show"><span>Browse</span></a></li>
>                 <li><a href="#fragment-2d"><span>Settings</span></a></
> li>
>             </ul>
>         </div>
>         <div id="fragment-3">
>              <ul>
>                 <li><a href="#fragment-3a"><span>New Template</span></
> a></li>
>                 <li><a href="#SettingsEditAction.do"><span>Templates</
> span></a></li>
>                 <li><a href="#fragment-3b"><span>Received</span></a></
> li>
>                 <li><a href="#fragment-3c"><span>Posted</span></a></
> li>
>                 <li><a href="#fragment-3d"><span>Settings</span></a></
> li>
>             </ul>
>         </div>
>         <div id="fragment-4">
>              <ul>
>                 <li><a href="#fragment-4a"><span>System</span></a></
> li>
>                 <li><a href="#fragment-4b"><span>Buyer</span></a></
> li>
>                 <li><a href="#fragment-4c"><span>Archived</span></a></
> li>
>                 <li><a href="#fragment-4d"><span>Settings</span></a></
> li>
>             </ul>
>         </div>
>         <div id="fragment-5">
>              <ul>
>                 <li><a href="#fragment-5a"><span>Monthly Sales</span></
> a></li>
>                 <li><a href="#fragment-5b"><span>Daily Sales</span></
> a></li>
>                 <li><a href="#fragment-5c"><span>Ebay Fees Report</
> span></a></li>
>             </ul>
>         </div>
>         <div id="fragment-6">
>              <ul>
>                 <li><a href="#fragment-6a"><span>Create New</span></
> a></li>
>                 <li><a href="#fragment-6b"><span>Shipments</span></a></
> li>
>                 <li><a href="#imageLoader"><span>Settings</span></a></
> li>
>             </ul>
>         </div>
>         <div id="fragment-7">
>              <ul>
>                 <li><a href="#fragment-7a"><span>eBay Token</span></
> a></li>
>                 <li><a href="#SettingsEditAction.do?
> action=editUser"><span>Settings</span></a></li>
>             </ul>
>         </div>
> </div>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to