View InvisibleGateway-Re-usableJavaScript-Solution3JS.js
This file contains 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
$(".revealTrigger").click(function () { | |
$($(this).closest(".revealGroup")).find(".revealTarget").show(); | |
return false; | |
}); |
View InvisibleGateway-Re-usableJavaScript-Solution2JS.js
This file contains 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
$(".revealTrigger").click(function () { | |
$($(this).attr("rel")).show(); | |
return false; | |
}); |
View InvisibleGateway-Re-usableJavaScript-Solution1JS.js
This file contains 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
/* The first line below just binds a click event function | |
to an object obtained by writing a CSS-style selector - | |
which, by the way, is at the heart of jQuery's usefulness */ | |
$("#revealLogin").click(function () { | |
$("form#userLogin").show(); | |
return false; // This just keeps the browser from jumping to the top | |
}); |
View InvisibleGateway-Re-usableJavaScript-Solution3CSS.css
This file contains 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
.revealTarget { | |
/* set this up to be hidden on page load */ | |
display: none; | |
} |
View InvisibleGateway-Re-usableJavaScript-Solution2CSS.css
This file contains 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
form#userLogin { | |
/* set this up to be hidden on page load */ | |
display: none; | |
} |
View InvisibleGateway-Re-usableJavaScript-Solution1CSS.css
This file contains 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
form#userLogin { | |
/* set this up to be hidden on page load */ | |
display: none; | |
} |
View InvisibleGateway-Re-usableJavaScript-Solution3HTML.html
This file contains 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
<div class="revealGroup"> <!-- Element Group 1 --> | |
<a class="revealTrigger" href="#">Log In</a> | |
<form class="revealTarget" id="userLogin" ...> | |
<label for="username">Username:</label> | |
<input id="username" type="text" /> | |
<label for="password">Password:</label> | |
<input id="password" type="password" /> | |
</form> | |
</div> | |
<div class="revealGroup"> <!-- Element Group 2 --> |
View InvisibleGateway-Re-usableJavaScript-Solution1HTML.html
This file contains 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
<a id="revealLogin" href="#">Log In</a> | |
<form id="userLogin" ...> | |
<label for="username">Username:</label> | |
<input id="username" type="text" /> | |
<label for="password">Password:</label> | |
<input id="password" type="password" /> | |
</form> |
View InvisibleGateway-Re-usableJavaScript-Solution2HTML.html
This file contains 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
<a class="revealTrigger" href="#" rel="form#userLogin">Log In</a> | |
<form id="userLogin" ...> | |
<label for="username">Username:</label> | |
<input id="username" type="text" /> | |
<label for="password">Password:</label> | |
<input id="password" type="password" /> | |
</form> |