Guest User

Untitled

a guest
Jun 8th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. Jquery Ajax loading image while getting the data
  2. <script type="text/javascript">
  3. jQuery(function($) {
  4. $(document).ready(function() {
  5. $("#imgs").hide();
  6. $(".letter").bind('click', function(){
  7. $("#imgs").fadeIn();
  8. var val = $(".letter").val;
  9. var site = '<?php echo site_url(); ?>';
  10. $.ajax({
  11. url: site+'/wp-content/themes/premiumnews/newContent.php?letter='+$(this).html(),
  12. success:function(data){
  13. $("#imgs").hide();
  14. $("#content1").html(data);
  15. }
  16. });
  17. });
  18. });
  19. });
  20. </script>
  21.  
  22. $('#loading_div').hide().ajaxStart(function(){
  23. $(this).show();
  24. }).ajaxStop(function() {
  25. $(this).hide();
  26. });
  27.  
  28. $("#content1").html("<img style="margin-left: auto; margin-right: auto;" src="ajax-loader.gif" alt="Loading..." title="Loading..." />");
Advertisement
Add Comment
Please, Sign In to add comment