Metodat fadeOut dhe fadeIn në jQuery
Metodat fadeOut dhe
fadeIn
implementojnë zhdukjen dhe shfaqjen e butë
të elementit.
Le të marrim kodin HTML vijues:
<button id="hide">hide</button>
<button id="show">show</button>
<div id="elem">text...</div>
Për këtë kod është shkruar CSS vijues:
#elem {
padding: 10px;
width: 150px;
height: 150px;
border: 1px solid green;
margin-top: 10px;
}
Tani le të implementojmë metodat fadeOut dhe
fadeIn:
$('#hide').click(function() {
$('#elem').fadeOut(1000);
});
$('#show').click(function() {
$('#elem').fadeIn(1000);
});