Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to set a defualt tab with Jquery UI

    Hello There,

    I am using Jquery Tabs http://jqueryui.com/demos/tabs/ with the codes below

    Code:
    <script type="text/javascript"> 
    	$(function() {
    		$( "#tabs" ).tabs().addClass( "ui-tabs-vertical ui-helper-clearfix" );
    		$( "#tabs li" ).removeClass( "ui-corner-top" ).addClass( "ui-corner-left" );
                  $("#tabs").tabs( { fx: { height: 'toggle', opacity: 'toggle' } } );
    	});
    	</script>
    I have got 4 tabs and I want to link each of them in the menu. Therfore I must arrange the default one in my each html page. How can I do that?

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,930
    Thanks
    56
    Thanked 550 Times in 547 Posts

  • #3
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you xelawho!

    I have already found this answer but I couldnt get anything or any answer from this page. Dont know how to use it as a solution.

    Cheers.

  • #4
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,930
    Thanks
    56
    Thanked 550 Times in 547 Posts
    haha. the funny thing about that link is that it doesn't link to the tab in question.

    ahem.

    If you click on "options" then "selected" you'll see this:
    PHP Code:
    selected

    Zero
    -based index of the tab to be selected on initializationTo set all tabs to unselected pass -as value.
    Code examples

    Initialize a tabs with the selected option specified
    .

        $( 
    ".selector" ).tabs({ selected});

    Get or set the selected optionafter init.

        
    //getter
        
    var selected = $( ".selector" ).tabs"option""selected" );
        
    //setter
        
    $( ".selector" ).tabs"option""selected"); 
    or does that still not help?

  • #5
    New to the CF scene
    Join Date
    Jul 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the details. Now I can see the source better!

    And I think I've solved it. And I think no need for any changes like in the page you suggested. Because I tried and saw that "mypage.html#tabs-2" (or 3 or 4) can be visited from any page via Menu, but not from the same page. I mean it doesnt allow us to visit tabs via menu of the web site if we are already at the page of the tabs. It wants us to use the tabs instead of menu.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •