Monday, 15 July 2013

html - Jquery extend time -



html - Jquery extend time -

hey guys new jquery , need add together time limit loading image.its gif file..my code is

<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script>$(document).ready(function(){ var imagename=$("#name").val(); $("#back").hide(); $("form").submit(function(event){ $("#data").hide(); $("#image").show(); $("#image").html('<br/><br/><img src="fuck.gif" width="100" height="100"/><br/><br/><br/>loading image ...'); $.post( "images.php", $( "#data" ).serialize(),function(data){ $("#image").show(); $("#back").show(10000); $("#image").html("<img src='images.php'/>");} ); event.preventdefault(); }); $("#back").click(function(){ $("#back").hide(); $("#image").html("by <b>akash sharma</b> (hsakapandit@gmail.com)"); $("#data").show(10000); }); }); </script>

when utilize code image appear came in action 1 sec when tried adding duration of image $("#back").show(10000); if know how add together period of time more loading image please help me ..

thanks in advance..

.show() not back upwards duration, instant.

you might looking fadein() or animate() instead.

$("#back").fadein( 10000 ); // 10000 milliseconds, or 10 seconds

http://api.jquery.com/fadein/

$("#back").animate({ opacity: 1.00 // identify property animate }, 10000 ); // 10000 milliseconds, or 10 seconds

http://api.jquery.com/animate/

either method require set opacity = 0 on #back element prior use, like:

$("#back").fadeto( 1, 0.00 ); // fade 0% opacity, in 1 millisecond

or like:

$("#back").css( "opacity", 0.00 );

jquery html

No comments:

Post a Comment