How do I tell my slideToggle where to look?

Head out to http://www.brucegust.com/portfolio/verizon/toggle_model_smooth.php. If you click on the triangle to the right of Arpana's name, you'll see some hidden content appear.

Now, go out to http://www.brucegust.com/portfolio/verizon/toggle_model.php#. It's the same page, but you'll notice I've got some additional content in the row that used to be simply "Arpana." The addition of those <span> tags apparent confuses my JavaScript command I want to know what to tell my function to look for so it reveals the hidden content.

So, in other words, this works:

<td style="height:44px; background-color:red; padding:0;" colspan="4"><img src="images/avatar.png" style="vertical-align:middle;"><a href="mailto:Aparna.Khurjekar@VerizonWireless.com" style="color:#ffffff; text-decoration:none;">Arpana Khurjekar</a>&nbsp;<a href="#"  class="display_show" style="color:#ffffff; text-decoration:none; outline:0;">&#9660;</a>
			<div class="slidingManagerTerms">
				<table style="background-color:#ffffff; width:100%;">
					<tr>
						<td>stuff</td>
					</tr>
					<tr>
						<td>more stuff</td>
					</tr>
				</table>		
			</div>
		</td>

Open in new window


...this does not:

	<td style="height:44px; background-color:red; padding:0;" colspan="4"><img src="images/avatar.png" style="vertical-align:middle;"><a href="mailto:Aparna.Khurjekar@VerizonWireless.com" style="color:#ffffff; text-decoration:none;">Arpana Khurjekar</a>&nbsp;<a href="#"  class="display_show" style="color:#ffffff; text-decoration:none; outline:0;">&#9660;</a><span style="margin-left:240px; color:#ffffff;">VP-Network Ops & Eng - South</span><span style="margin-left:80px; color:#ffffff;">704-510-6001</span><span style="margin-left:59px; color:#ffffff;">732-407-9388</span>
			<div class="slidingManagerTerms">
				<table style="background-color:#ffffff; width:100%;">
					<tr>
						<td>stuff</td>
					</tr>
					<tr>
						<td>more stuff</td>
					</tr>
				</table>		
			</div>
		</td>

Open in new window


...and I'm assuming it's because the addition of the span tags confuses the slideToggle function as far as what to look for.

How can I fix that?
brucegustPHP DeveloperAsked:
Who is Participating?
 
Slick812Commented:
It looks like the .next( ) does not keep looking for the next and more after that, if the spans are there, since the slidingManagerTerms  is no longer right behind it?

  not tested this but you could try -
$(this).parent().find('.slidingManagerTerms').slideToggle();
0
 
brucegustPHP DeveloperAuthor Commented:
I figured it out, Slick! Thanks so much for your input!
0
 
Slick812Commented:
Glad I could help, , some of the method names used in Jquery like -  .next( )  - do not really indicate what that method does or how it is related to the DOM element arrangement.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.