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 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    java tabs issues, cant get fade or rotate to work

    here's the code i've got to make some tabbed content on my website:

    Code:
    $(document).ready(function(){
    $('#headingHome div').hide(); // Hide all divs
    $('#headingHome div:first').show(); // Show the first div
    				
    $('.ticker_buttonP a:first').addClass('active'); // Set the class of the first link to active
    				
    $('.ticker_buttonP a').click(function(){ //When any link is clicked
    	$('.ticker_buttonP a').removeClass('active'); // Remove active class from all links
    	$(this).addClass('active'); //Set clicked link class to active
    	var currentTab = $(this).attr('href'); // Set variable currentTab to value of href attribute of clicked link
    	$('#headingHome div').hide(); // Hide all divs
    	$(currentTab).show(); // Show div with id equal to variable currentTab
    	return false;
    	});	
    });
    and my html (all content removed for size's sake):
    Code:
    <div id="headingHome">
    
    <div id="first"></div><!-- /first -->
    
    <div id="second"></div><!-- /second -->
    
    <div id="third"></div><!-- /third -->
    
    <div id="fourth"></div><!-- /fourth -->
    
    <div id="fifth"></div><!-- /fifth -->
    
    
    <p class="ticker_buttonP">
    <a href="#first"></a>
    <a href="#second"></a>
    <a href="#third"></a>
    <a href="#fourth"></a>
    <a href="#fifth"></a>
    </p>
    
    </div><!-- /headingHome -->
    that works fine so far, however i want the content to fade in and out when the tabs change, and i also want the tabs to rotate automatically like seen on this site: http://www.sosfactory.com/

    I'm new to this, and I cant find anything on the net about it that i can understand enough to put it together. could anyone help me, please?

    many thanks
    Last edited by trezhurisland; 09-14-2011 at 10:45 PM.


 

Tags for this Thread

Posting Permissions

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