Created
June 11, 2013 22:01
-
-
Save caioerick/5761130 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<style type="text/css"> | |
p.neat { | |
display: none; | |
clear: both; | |
margin: 1em 0; | |
padding: 1em 15px; | |
width:100px; | |
background: #0F67A1; | |
} | |
</style> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
$('#animate-fade').click(function () { | |
$('.neat').animate({ opacity : 'toggle' }, 'slow'); | |
}); | |
$('#animate-slide').click(function () { | |
$('.neat').slideToggle('slow'); | |
}); | |
$('#animate-both').click(function () { | |
$('.neat').animate({ | |
opacity: 'toggle', | |
height: 'toggle' | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<title>Fade com jQuery</title> | |
<body> | |
<input type="button" id="animate-slide" value="slide" /> | |
<input type="button" id="animate-fade" value="fade" /> | |
<input type="button" id="animate-both" value="both" /> | |
<p class="neat"> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do | |
eiusmod tempor incididunt ut labore et dolore magna aliqua. | |
</p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment