Jump to content

fast question on adding two statements together


Shadowing

Recommended Posts

Hey guys i want my java script to read, if any of these two elements are clicked it will toggle them.cant figure out how to do this wondering if someone could please assist me. I think my problem is im trying to do java script to much like i would php. Cause apparently its differant lol. Also maybe i cant do this using user made toggle? cause one clicky would change the order events for the other clicky? this is just a off and on toggle though. but was curious if i had a 3rd click action and how it would effect having two elements attached. lol if any of that makes sense.

$("input#show_invitations_button") || $("th#show_invitations").toggle(function(event){

and i dont understand why i cant simply do something like this

$("input#show_invitations_button").toggle(function(event) {$("th#show_invitations").toggle(function(event){

here is the full code its being used on.

<script>$(function(){    $("div#application_<?php echo $d; ?>").hide();    $("tr#application_subject").hide();  $("th#application_subject").hide();    $("tr#row_app_<?php echo $d; ?>").hide();  $("td#row_app_<?php echo $d; ?>").hide();  $("input#show_invitations_button") || $("th#show_invitations").toggle(function(event){		$("tr#application_subject").show();	$("th#application_subject").show();		$("tr#row_app_<?php echo $d; ?>").show();	$("td#row_app_<?php echo $d; ?>").delay(<?php echo $z += 200; ?>).fadeIn("slow");},  function(){	 $("th#application_subject").fadeOut("slow" , function() {	  $("tr#application_subject").hide();	 });	$("td#row_app_<?php echo $d; ?>").delay(<?php echo $z += 200; ?>).fadeOut("slow", function() {	  $("tr#row_app_<?php echo $d; ?>").hide();	});		  }); 	$("input#application_<?php echo $d; ?>").click(function(event){   	 event.preventDefault();   	 $("div#application_<?php echo $d; ?>").show();  });});</script> 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...