jquery - How to hide flash message after few seconds? -


in application user can post challenge other user. after successful posting challenge displaying 1 flash message same. want hide message after few seconds. wrote following code :

        $(document).ready(function(){                     settimeout(function() {                     $("#successmessage").hide('blind', {}, 500)                     }, 5000);         });         <div id="successmessage" style="text-align:center; width:100%">                     <font color="green" >                          <%if flash[:alert]=="your challenge posted successfully."%>                                      <h4><%= flash[:alert] if flash[:alert].present? %>                          <%end%>                     </font>         </div> 

but code not hiding div "successmessage".

you can try :

            settimeout(function() {             $('#successmessage').fadeout('fast');             }, 30000); // <-- time in milliseconds 

if used div hide after 30 sec.i tried 1 , worked me.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -