JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 23rd, 2011, 01:37 AM
rbflowers rbflowers is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2010
Posts: 9 rbflowers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 1 m 13 sec
Reputation Power: 0
Other - JQuery help

I'm making a website for a friend and one of the pages is a portfolio page.

Ideally, I would like the page to have a table on top with different types of media he works on. When the user clicks on one of these tabs, his work on certain projects would slide down.

If the user clicks another tab, the originally pressed one should slide up and the new tab should slide down.

Here is the function code I have. This code correctly slides down each tab, but does not make a tab pressed before it return:
Code:
		<script type="text/javascript" src="jquery.js"></script>
		<script type="text/javascript"> 
			$(document).ready(function(){
			$(".videos").click(function(){
				$(".vidpanel").slideDown("normal");
				$(".phopanel").animate({height:260},"fast");
				$(".logpanel").animate({height:260},"fast");
				$(".pospanel").animate({height:260},"fast");
				$(".buspanel").animate({height:260},"fast");
				$(".webpanel").animate({height:260},"fast");
			  });
			});
			$(document).ready(function(){
			$(".photos").click(function(){
				$(".phopanel").slideDown("normal");
				$(".vidpanel").animate({height:260},"fast");
				$(".logpanel").animate({height:260},"fast");
				$(".pospanel").animate({height:260},"fast");
				$(".buspanel").animate({height:260},"fast");
				$(".webpanel").animate({height:260},"fast");
			  });
			});
			$(document).ready(function(){
			$(".logos").click(function(){
				$(".logpanel").slideDown("normal");
				$(".phopanel").animate({height:260},"fast");
				$(".vidpanel").animate({height:260},"fast");
				$(".pospanel").animate({height:260},"fast");
				$(".buspanel").animate({height:260},"fast");
				$(".webpanel").animate({height:260},"fast");
			  });
			});
			$(document).ready(function(){
			$(".posters").click(function(){
				$(".pospanel").slideDown("normal");
				$(".phopanel").animate({height:260},"fast");
				$(".logpanel").animate({height:260},"fast");
				$(".vidpanel").animate({height:260},"fast");
				$(".buspanel").animate({height:260},"fast");
				$(".webpanel").animate({height:260},"fast");
			  });
			});
			$(document).ready(function(){
			$(".buscards").click(function(){
				$(".buspanel").slideDown("normal");
				$(".phopanel").animate({height:260},"fast");
				$(".logpanel").animate({height:260},"fast");
				$(".pospanel").animate({height:260},"fast");
				$(".vidpanel").animate({height:260},"fast");
				$(".webpanel").animate({height:260},"fast");
			  });
			});			
			$(document).ready(function(){
			$(".websites").click(function(){
				$(".webpanel").slideDown("normal");
				$(".phopanel").animate({height:260},"fast");
				$(".logpanel").animate({height:260},"fast");
				$(".pospanel").animate({height:260},"fast");
				$(".buspanel").animate({height:260},"fast");
				$(".vidpanel").animate({height:260},"fast");
			  });
			});
        </script>	

Here is the body code:
Code:
    <div class="portfolio">
    <table class="portfolioTable">
        <div class="vidpanel">
        	<p>Video portfolio shows up here.</p>
        </div>
    	<td class="videos" id="videos">Videos</td>
        <div class="phopanel">
        	<p>Photo portfolio shows up here</p>
        </div>
    	<td class="photos" id="photos">Photos</td>
        <div class="logpanel">
        	<p>Logos portfolio shows up here</p>
        </div>
   	    <td class="logos" id="logos">Logos</td>
        <div class="pospanel">
        	<p>posters portfolio shows up here</p>
        </div>
    	<td class="posters" id="posters">Posters</td><br />
        <div class="buspanel">
        	<p>business cards portfolio shows up here</p>
        </div>
    	<td class="buscards" id="business cards">Business Cards</td><br />
        <div class="webpanel">
        	<p>websites portfolio shows up here</p>
        </div>
    	<td class="websites" id="websites">Websites</td>
    </table>
    
    </div>

Reply With Quote
  #2  
Old July 20th, 2011, 03:50 PM
Bobidybob's Avatar
Bobidybob Bobidybob is offline
Contributing Abuser
Click here for more information
 
Join Date: Apr 2007
Location: Starkville, MS
Posts: 336 Bobidybob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 Days 15 h 51 m 40 sec
Reputation Power: 12
Send a message via AIM to Bobidybob
That's because you haven't told them to. You need to make all other tabs shrink whenever you click something.

Please don't use tables like that. There is all sorts of wrong going on there.
__________________

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Other - JQuery help


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap