In asp.net-mvc, How can I show a loading image while my other image is getting generated from Url.Action?

StackOverflow https://stackoverflow.com/questions/23202697

Вопрос

I have the following code:

 <img src="<%= Url.Action("LocationMap") %>" id="overlay" /> 

and it takes a little while for this to generate (as i am generating an image on the fly).

How can i show a "Loading . ." image or message, while this is being retrieved because right now it shows a broken image link until the image is loaded then it looks good . .

Это было полезно?

Решение

Something like this ?

It just says to add code similar to the following:

<script>
  $('img').load(function() {
      //Hide Loading Mask;
  });
</script>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top