I have an image that I need to hide an image after showing it for a particular interval. I wrote the following code for it.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script src="./1_files/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('div').delay(2000).show(0);
$('hide').delay(3000).hide(0);
});
</script>
</head>
<body>
<img id="hide" src="9.png" width="29" height="39">
</body>
</html>
The image is not hiding. It keeps getting displayed. Any ideas why? Thanks in advance.
In jQuery 1.7, it works just fine for me with this minor correction/change:
The two changes I made were:
.hide(1)which turns it into an animation that works with.delay().You can see it work here: http://jsfiddle.net/jfriend00/NGW8p/