Ich versuche, eine modale Bootstrap-Meldung anzuzeigen, während jQuery Daten in ein paar meiner DIVs (und dann wieder ausblenden). Die Daten aktualisieren ist OK. Das Modal blinkt jedoch sofort.jQuery Bootstrap-Modal während Dataload anzeigen/ausblenden
Dies ist auch der Fall, wenn ich einfach ein einfaches Lade-GIF-Bild anstelle des modalen verwenden. Nicht sicher, was ich falsch mache. Das Modal (oder GIF) muss beibehalten werden, bis die Daten vollständig aktualisiert sind.
Vielen Dank im Voraus für jede Hilfe!
JS Code:
$('.container').on('click', '.markAttend', function(event, ui) {
myApp.showPleaseWait(); //this calls the modal to display
event.preventDefault();
var contactID = $(this).attr('contactID');
var eid = <?php echo $eid ?>;
$.ajax({
url: 'functions-ajax.php',
type: 'post',
data: 'action=markAttend&contactID=' + contactID + "&eid=" + eid, //send a value to make sure we want to destroy it.
success: function(data){
$("#searchlist").load(location.href + " #searchlist"); //Refresh list
$("#attendanceTotal").load(location.href + " #attendanceTotal"); //Refresh list
$("#searchinput").val(''); //clear out search input field
myApp.hidePleaseWait(); //this calls the modal to hide
}
});
});
können Sie das gleiche auf jsfiddle, http://jsfiddle.net – dreamweiver