Download MagicSuggest

This is a great plugin, but I'm afraid that it does not yet support loading images for ajax requests. I tried to bind it using the ajaxSend event with no luck. I tried:

<div id="loading"><img src="loading.gif"/></div> 
ms1 = $('#ms1').magicSuggest({
                        data: ajaxJsonUrl,
                        sortOrder: 'text',
                        valueField: 'text',
                        displayField: 'text',
                        maxDropHeight: 200});

$('#ms1').bind("ajaxSend", function(){
                $("#loading").show();
            });

Is there a way to do this that I have not noticed?

+3
source share
1 answer

You can solve this problem using the beforeload and load events:

$(ms).on('beforeload', function(){
... // add your gif loader here
});

$(ms).on('load', function(){
... // remove loader
});
+4
source

All Articles