In this article we will discuss to create slide silde using id or class property using fadeOut () and fadeout() property. We can also set motion fast ,slow,medium and time line using the property.
Example:
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>slide property injquery</title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#animate').click(function () {
var box = $('.box');
if (box.is(':visible')) {
box.fadeOut('slow');
} else {
box.fadeIn('slow');
}
});
});
</script>
<style type="text/css">
div {
display: inline-block;
float: left;
color: #fff;
font-size: 13px;
padding-left: 5px;
}
.button {
background-color: #FF9800;
color: white;
margin: 20px;
padding: 10px;
}
.first {
width: 250px;
height: 200px;
background: #149DAF;
}
</style>
</head>
<body>
<div class="content">
<h2 style="color: #325696">slide using id& class property in jquery</h2>
<div>
<input type="button" id="animate" class="button" value="animate" />
</div>
<div class="box first">
<p>
<b>fade effect in jquery </b></br>
var box = $('.box');
if (box.is(':visible')) {
box.fadeOut('slow');
} else {
box.fadeIn('slow');
}
</p>
</div>
</div>
</body></html>
Output:
Post your comments / questions
Recent Article
- ModuleNotFounEerror:No module named celery in Django Project
- How to get domain name information from a Domain using Python
- ModulenotFoundError: no module named 'debug_toolbar' -SOLUTION
- How to create superuser in django project hosted in cPanel without terminal
- CSS & images not loading in django admin | cpanel without terminal
- Could not build wheels for mysqlclient, which is required to install pyproject.toml-based projects
- How to sell domain name on Godaddy (2023)
- TemplateSyntaxError at / Could not parse the remainder: ' + 1' from 'forloop.counter0 + 1'
Related Article