Home >Web Front-end >JS Tutorial >How to use fadeIn, fadeOut, and fadeTo in jQuery (picture display and hiding)_jquery
#img1
{
width:400px; height:500px;
}
$(function () {
$('#Button1').bind('click', function () {
$('img').fadeOut(2000, function () {
$ ('#Button1'). Val ('Hey, no'); // The disappearance of the picture
});
})
$('#Button2').bind('click', function () {
$('img').fadeIn(2000, function () {
through
});})
$('#Button3').bind('click', function () {
$('img').fadeTo(2000, 0.3, function () {
alert('Animation execution completed'); //Image transparency
});
})
$('#Select1').bind('change', function () { //Can be changed or click event
$('img').fadeTo(1000, $('#Select1 option:selected').val());
})
})