I'm currently working on a script that is intended to gradually fade an image from 80% opacity to 1%, but every time I click, it goes straight to the set opacity. How can I make the fading effect continuous? Any help would be appreciated. Here is the code I have so far:
<html>
<center><img src="image1.jpg" id="1"><br><img src="image2.jpg" width="500" height-"500" id="2" ></img></center>
</html>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#2").click(function() {
$("#1").fadeTo(500,.3);
});
});
</script>