I am trying to add opacity effect on the image. Its working only for the first image. This opacity effect is not working for the next images. I added jquery script also but its not working. Thanks in adance
$(document).ready(function() {
$("#imgDemo").css("opacity", 0.5);
$("#imgDemo").hover(function() {
$(this).animate({opacity: 1.0}, 500);
}, function() {
$(this).animate({opacity: 0.5}, 500);
});
});
body
{
padding: 10px;
}
span
{
font-family : Arial;
font-size : 14pt;
color: green;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<h2>Circle</h2>
<p>The .rounded-circle class shapes the image to a circle:</p>
<img src="http://3.bp.blogspot.com/-4p6k8mM7V7c/T6jolM6I_4I/AAAAAAAACL4/lTZyaeJyObM/s400/Change_Image_Opacity_Using_jQuery.jpg"" alt="Cinque Terre" width="304" height="236" id="imgDemo">
</div>
<div class="col-md-4">
<h2>Circle</h2>
<p>The .rounded-circle class shapes the image to a circle:</p>
<img src="http://3.bp.blogspot.com/-4p6k8mM7V7c/T6jolM6I_4I/AAAAAAAACL4/lTZyaeJyObM/s400/Change_Image_Opacity_Using_jQuery.jpg"" alt="Cinque Terre" width="304" height="236" id="imgDemo">
</div>
<div class="col-md-4">
<h2>Circle</h2>
<p>The .rounded-circle class shapes the image to a circle:</p>
<img src="http://3.bp.blogspot.com/-4p6k8mM7V7c/T6jolM6I_4I/AAAAAAAACL4/lTZyaeJyObM/s400/Change_Image_Opacity_Using_jQuery.jpg"" alt="Cinque Terre" width="304" height="236" id="imgDemo">
</div>
</div>
</div>
</body>