To add plugin to a page, we need to download plugin.js file and also include jQuery Library to the script block of the page. Below example we are going to make a slideshow effect using cycle plugin. It provides different options to have different transition effects and layouts.
Example:
<html>
<head>
<title> adding plugin toa page </title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.cycle/3.0.3/jquery.cycle.all.min.js"></script>
<script type="text/javascript">
(function ($) {
$(document).ready(function () {
$('.slider').cycle('fade');
});
})(jQuery);
</script>
<style type="text/css">
.slider img {
padding: 15px;
border: 1px solid #ccc;
background-color: #eee;
width: 500px;
height: 300px;
top: 0;
left: 0;
}
</style>
</head>
<body style="width: 600px">
<div class="slider">
<img src="images/hua001.jpg" alt="Beach 1" />
<img src="images/hua002.jpg" alt="Beach 2" />
<img src="images/hua003.jpg" alt="Beach 3" />
</div>
</body>
</html>
Output:
Post your comments / questions
Recent Article
- How to check PAN-Aadhaar is Linked or NOT?
- How to customize pagination for django admin?
- How to fix HAXM is not installed |in Android Studio
- How to fix CMOS Checksum Error in Computer or Laptop | SOLVED
- Reactivating windows after a Hardware change on PC or Laptop
- FIXED: Windows reported that the hardware of your device has changed. Error code :0xc004F211
- "redirect" is not defined pylance("reportUndefinedVariable)
- This action cannot be completed because the file is open in SQL Server(SQLEXPRESS) - FIXED
Related Article