SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    bootstrap tabbable tabs and setting one of them to active.

    Hope it's ok to post this here. As I understand it bootstrap is used quite a bit in conjuction w/roots
    so got this code...

    Code:
    					<div class="tabbable tabs-top">
    						<ul class="nav nav-tabs">
    						<li class="active"> <a href="#html" data-toggle="tab">html/css</a> </li>
    				
    						<li class=""> <a href="#php" data-toggle="tab">php/css</a> </li>
    				
    						<li class=""> <a href="#css" data-toggle="tab">whatever/css</a> </li>
    
    						</ul>	
    						<div class="tab-content"> 
    							<div class="tab-pane active" id="html"> </div>
    								<p>htmlish stuff and content</p>
    								
    							<div class="tab-pane" id="php"> </div>
    								<p>phpish stuff and content</p>
    								
    							<div class="tab-pane" id="css"> </div>
    								<p>css stuff and content</p>
    						</div> <!-- tabcontent end -->
    					</div>
    giving one of the tabs the class of "active" and it's respective <a href> a class of active as well should only show the content for that tab. The other content would only be displayed when the user click on the other tabs.
    In my case the content for each tab shows all the time.
    So where did I go wrong?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,171
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    We can't tell where you are going wrong without seeing how you are trying to show/hide your content. Are you using JS, or CSS, or both?

    Here are some pretty easy ways to set up tabbed content: http://pageaffairs.com/code/code-for-creating-tabs

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    724
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hello there Ralph!
    i am using whatever came w/twitter bootstrap.
    Just started using it, currently on my sandbox. will go check out the link you provided. thanks!


Bookmarks

Posting Permissions

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