Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
need help with some tabs ... i`m a newbie
Old 09-22-2010, 05:31 AM need help with some tabs ... i`m a newbie
rober7's Avatar
Skilled Talker

Posts: 96
Name: robert haba
Trades: 0
i have 3 tabs and i want to make active (when page loads) second tab. And i wonder if is possible to make tabs rotate (i read about this command .tabs( "rotate" , ms , [continuing] ) but i dont know where to put it)

i use this code for my ajax tabs

Code:
$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});

and this for html


Code:
<ul class="tabs">
    <li><a href="#tab1">Pages</a></li>
    <li><a href="#tab2">Categories</a></li>
	<li><a href="#tab3">Follow us</a></li>
</ul>

<div class="tab_container">
    <div id="tab1" class="tab_content">
        x<!--Content-->
    </div>
	
	
    <div id="tab2" class="tab_content">
       y<!--Content-->
    </div>
	
	    <div id="tab3" class="tab_content">
       z<!--Content-->
    </div>
	
	
	
</div>
__________________

Please login or register to view this content. Registration is FREE
- open blog | working on it ...
rober7 is offline
Reply With Quote
View Public Profile Visit rober7's homepage!
 
 
Register now for full access!
Old 09-24-2010, 08:25 AM Re: need help with some tabs ... i`m a newbie
Extreme Talker

Posts: 246
Trades: 0
It doesn't look like you're using the jQuery tab control. Wouldn't that be easier to use and manipulate? (that is actually where the .tabs( "rotate" , ms , [continuing] ) comes from)

http://docs.jquery.com/UI/Tabs
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
stbuchok is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to need help with some tabs ... i`m a newbie
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09664 seconds with 12 queries