Instead of using visibility:hidden
to hide the div
, you may want to consider this alternative approach:
<div id="divLogin" style="display: none">
Then, update your code like so:
$("#btEnviarAcesso").click(function () {
$("#divLogin").slideToggle("slow");
});
This assumes that there is an element with the ID of btEnviarAcesso
that can trigger a click
event.
NOTE: Remember to encapsulate this script within a document.ready
function:
$(document).ready(function(){ // Or $(function(){ ...
$("#btEnviarAcesso").click(function () {
$("#divLogin").slideToggle("slow");
});
});
You can check out a live demo of this solution in action here.
Note 2
Replace the following:
<script src="jquery-1.3.2.min.js"/>
<script language="javascript">
With this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">