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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    106
    Thanks
    27
    Thanked 3 Times in 3 Posts

    JQuery UI Tabs issue

    Hi all,
    I'm using UI Tabs in my website and there is an option which is called "selected" and controls the selected tab. In documentation it says:



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

    Initialize a tabs with the selected option specified.

    $('.selector').tabs({ selected: 3 });

    Get or set the selected option, after init.

    //getter
    var selected = $('.selector').tabs('option', 'selected');
    //setter
    $('.selector').tabs('option', 'selected', 3);



    The problem is that I can't make the selected: -1 value work. This is my code:
    Code:
    $(function() {
    		$("#tabs").tabs({
    			event: 'mouseover',
    			selected: -1,
    			fx: { height: 'toggle' }
    		});
    		
    		$("div#header_flash").mouseover(function(){
    			$('#tabs').tabs('option', 'selected', -1);
    		});
    		
    		$("div#main_inner").mouseover(function(){
    			$('#tabs').tabs('option', 'selected', -1);
    		});
    		
    	});
    and te meaning of it is when mouseovering on specific divs, all tabs should be closed.
    Can you help me find what's the problem here?? I'm trying to solve this for a week... please help me
    Last edited by ktsixit; 07-15-2009 at 10:34 AM.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You have to set "collapsible: true" first, then you can set the selected option to -1. I can't get it to work without the collapsible being set to true.

  • Users who have thanked Fumigator for this post:

    ktsixit (07-15-2009)

  • #3
    Regular Coder
    Join Date
    Sep 2008
    Posts
    106
    Thanks
    27
    Thanked 3 Times in 3 Posts
    omg, I can't believe it worked...
    You can't imagine how many stupid things I've tried all these days, and how many hours I wasted experimenting and searching in forums.
    Thank you so much.. you saved me in this


  •  

    Posting Permissions

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