質問

This is a great plugin indeed, but i'm afraid it doesn't support a loading image for ajax requests yet. I tried to bind it using an "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 any way to do this that I have not noticed?

役に立ちましたか?

解決

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

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

$(ms).on('load', function(){
... // remove loader
});
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top