Is there a way, and how can I remove the loading animation that's built into the ColdFusion AJAX functions?
<cfinput type="text" name="TitleName" autosuggest="cfc:MyCFC.AutoSuggestSearch({cfautosuggestvalue})">
Using the following code creates a small icon next to my search field which animates while the AJAX request is waiting 开发者_Python百科for a response. Is there a way to remove this animation icon?
There is an easier, and more importantly, a right way of doing it. Go inside your CFINPUT tag and choose the attribute called SHOWAUTOSUGGESTLOADINGICON
and select False
. Done!
Try adding this to the head section of your page:
<script language="JavaScript">
_cf_loadingtexthtml="";
</script>
Note that you should be able to put your own HTML into that string, to display a custom loading graphic or some other message instead, if you like.
The following code does not work for me:
<script language="JavaScript">
_cf_loadingtexthtml="";
</script>
My solution was to use "visitbility:hidden" on the following layers generated by ColdFusion, and to use negative margins to remove the space reserved for the image (note that "collapse" does not work:
#TitleNameloadingicon {visibility:hidden;}
#TitleName_cf_button {visibility:hidden;}
This solution was further improved by Adam Tuttle, who suggested using "display:none" instead of "visibility:hidden;" which entirely eliminates the space reserved for the loading graphic.
精彩评论