just starting to learn the Ajax() function within jquery. trying to make a widget where image loader will appear until the images are loaded from server.
I want to apply the same for all the images comes in these li's.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
li { padding: 10px; }
ul.imageList li .pics { height: 50px; width:50px; }
</style>
<script type="text/javascript" language="javascript" src="jquery.js"></script>
<script type="text/javascript">
$('document').ready(function() {
$('#click').click(function(event) {
event.preventDefault();
$(".imageList li").html('<img src="http://deltaplanveter.ru/app/webroot/img/loader.gif" />');
$(".imageList li").load('1.png');
});
});
</script>
</head>
<body>
<div class="images">
<ul class="imageList">
<li><img src="1.png" class="pics" /></li>
<li><img src="2.png" class="pics" /></li>
<li><img src="3.png" class="pics" /></li>
<li><img src="4.png" class="pics" /></li>
</ul>
<a href="#" id="click">Show Images</a>
</div>
</body>
</html>
Please check my live code here http://jsfiddle.net/ylokesh/cZ6F7/
Thanks ! Lokesh Yadav