0

I'm using MVC, Jquery and Jquery Mobile.

Basically what I'm doing is when someone saves a form it posts back and adds a parameter to the page. I created code to show a saved div if the parameter exists. I also added a little jquery to remove the div after 3 seconds.

$("#SavedDiv").delay(3000).fadeOut("slow");

I want to add a overlay panel so I added jquery mobile to my project. After added jquery my $("#SavedDiv").delay(3000).fadeOut("slow"); line stopped working. It works the first time, but after that it doesn't work again.

What is going on? If I remove the jquery mobile references it starts working again.

If I put an alert in the code the alert does execute, but seems to do so before the page is rendered.

   <script>
       $(document).ready(function () {
           $("#SavedDiv").delay(3000).fadeOut("slow");
           alert('test');
       });
   </script>  
Jim
  • 83
  • 1
  • 6
  • Create an MVCE (http://stackoverflow.com/help/mcve) to demonstrate this case so we have more context. With the information given, there's no way to know for sure what's going on. – Palpatim Aug 20 '15 at 14:44
  • I think that document ready event can be the problem. Take a look to the answer on this question: http://stackoverflow.com/questions/14468659/jquery-mobile-document-ready-vs-page-events – jcarrera Aug 20 '15 at 17:09

0 Answers0