Created
April 30, 2013 14:42
-
-
Save treasonx/5489172 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Gets a jquery object containing all of the elements on the page that have a css class of "show-example1" | |
var showDescriptionInput = $('.show-example1'); | |
//when someone clicks on an element with the id of "name" or "phone" run this function. I think "click.toggle" | |
//is a mistake it should be just click | |
$("#name, #phone").bind('click.toggle', function(e) { | |
//dont do the default HTML thing. SO if this is a link dont make the browser load the new page. | |
e.preventDefault(); | |
//if the thing we clicked on has an id of "name" | |
if ($(this).prop('id') == 'name') { | |
//show this thing or things :) | |
showExample2.show(400); | |
} else { | |
//just hide | |
showExample2.hide(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment