Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-14-2012, 08:28 PM   PM User | #1
siyord
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
siyord is an unknown quantity at this point
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?
siyord is offline   Reply With Quote
Old 02-14-2012, 10:40 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,461
Thanks: 52
Thanked 457 Times in 455 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
http://jqueryui.com/demos/tabs/#option-selected
xelawho is offline   Reply With Quote
Old 02-14-2012, 10:59 PM   PM User | #3
siyord
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
siyord is an unknown quantity at this point
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.
siyord is offline   Reply With Quote
Old 02-14-2012, 11:19 PM   PM User | #4
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,461
Thanks: 52
Thanked 457 Times in 455 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
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?
xelawho is offline   Reply With Quote
Old 02-15-2012, 09:23 PM   PM User | #5
siyord
New to the CF scene

 
Join Date: Jul 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
siyord is an unknown quantity at this point
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.
siyord is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:08 AM.


Advertisement
Log in to turn off these ads.