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

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 04-15-2009, 08:51 PM   PM User | #1
mcChris
New to the CF scene

 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mcChris is an unknown quantity at this point
work samples with accordion behavior

i'm trying to get my portfolio online and want to use an accordion-like behavior for my samples...

here's my js:

Code:
<script type="text/javascript">
	$(document).ready(function() {
		$('.work').hide();
		$('h3.heading').eq(3).addClass('active');
		$('.work').eq(3).show();
		
		$('h3.heading').click(function(){
			$('.work:visible').slideUp('slow');
			$(this).next('.work').slideDown('3000');
			$('li > h3.heading').removeClass('active');
			$(this).toggleClass('active');
		});
	});
</script>
here's my html:

Code:
			<ul id="projects">
				<li>
					<h3 class="heading"><span>1 | </span>Company A</h3>
					<div class="work">
					<ul class="projHead">
						<li class="number">1 |</li>
						<li class="name"><h3>Company A</h3></li>
						<li class="arrow"><!--spanner--></li>
					</ul>
					<div class="projContent">
						<img src="projects/compA.jpg" width="528" height="260" alt="Utah Prenatal Massage" />
						<p class="details">blah blah blah</p>
					</div>
					<ul class="projFoot">
							<li><a>details</a></li>
							<li class="last"><a>visit site</a></li>
					</ul>
					</div>
				</li>
</ul>
i've got this all styled correctly, and it functions correctly if i include display:none; in the css; however, i'm wanting to go a more accessible route, and have attempted to use both .hide(); and .css('display', 'none'); in the js...but, while the content hides as intended, the space taken up by the content remains...any thoughts on how i can get rid of it?...

also, i want the 'details' info to fadeIn and fadeOut on click and i'm unsure how to incorporate this action into the js...any ideas?
mcChris 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 11:04 PM.


Advertisement
Log in to turn off these ads.