Solved

preload until the content of a jquery dialog is loaded

Posted on 2014-07-22
1
483 Views
Last Modified: 2014-07-23
I have this code :
<script type="text/javascript">
$(function() {
  $(".busqueda").click(function(){
  var element = $(this);
  var del_id = element.attr("id");
  var del_name = element.attr("name");

  function loadData(page,del_id,del_name){
     $.ajax
     ({type: "POST", url: "ajax2.php", data: { page: page, rID: del_id, tID: del_name, ancho: 768 },
       success: function(msg){
         $("#medios").bind('dialogopen').bind('dialogclose', function() {  $(this).dialog('destroy'); })
         .dialog({autoOpen: false, maxHeight: 0.95 * $(window).height(), width: 800, modal: false,
                  position: 'top', resizable: false, autoResize: true }).dialog('open');
	   
	     $(document).ajaxComplete(
	        function(event, request, settings)
		    { $("#tabla").html(msg); }); }
         });
       }
       loadData(1,del_id,del_name);  
       $(document).on("click",'.container .pagination1 li.active',function()
	   { var page = $(this).attr('p'); loadData(page,del_id,del_name);});           
  });
});		
</script>

Open in new window


It works without a problem, but I would like to know if it is possible to add it preload while the content of the "jquery dialog" is loaded?
0
Comment
Question by:altariamx2003
1 Comment
 

Accepted Solution

by:
altariamx2003 earned 0 total points
ID: 40213568
this is the solution
--------------------------------------------------------
                 function loading_show(){
                    $('#loading').html("<img src='../../imagenes/loading.gif'/>").fadeIn('fast');
                }
                function loading_hide(){
                    $('#loading').fadeOut('fast');
                }  
--------------------------------------------------------
     loading_show();
  $.ajax{

           $(document).ajaxComplete(
              function(event, request, settings)
                { loading_hide(); something}
         });}
--------------------------------------------------------
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
JQuery & CSS Tab Issues 7 27
Understanding Trigger in Jquery 10 26
CSS Divs in Safari 3 18
Different Delete Messages 7 10
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a pageā€¦
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now