$.ajax({
type:"GET",
url:"<?php echo Yii::app()->request->baseUrl; ?>/admin/"+urlPage+"?t=ajax&img="+$("#image_name").val()+"&w="+
thumb_width+"&h="+thumb_height+"&x1="+x_axis+"&y1="+y_axis,
cache:false,
success:function(rsponse)
{
$("#cropimage1").hide();
$("#thumbs1").html("");
if(th_size == '1'){
$("#thumbs").html("<img src='<?php echo Yii::app()->request->baseUrl; ?>/upload/temporary/thumb/"+rsponse+"?version="+Math.ceil(Math.random()*100)*10+"' /><input type='button' class='save-btn' onclick='refresh();' name='save' value='<?php echo Yii::t(Yii::app()->session["translator"], "Save and continue");?>'>");
$('html, body').animate({ scrollTop: $('#thumbs').offset().top }, 'slow');
document.getElementById("small_image").value =rsponse;
//alert(document.getElementById("small_image").value)
}
}
Here am loading a div id “thumbs” dynamically on response from ajax call.Inside this thumbs div there is an image and submit button .. The issue is that the submit button loads quickly but if the image is heavy its taking time to load. How can i make submit button to load after image .. Any Help appreciated ?
Here is my suggestion, I use jQuery throughout instead of mixing things