javascript - Show div for a moment then switch to another div in jquery -
i'm trying make animation jquery 1.9.1 want show div short moment switch defualt div @ button click. far i've tried using show() & hide() method. nothing working. here codes,
<script> $(document).ready(function (){ $('#btnchange').click(function () { $('#red').hide(); $('#blue').show().delay(1500).hide(); $('#red').show(); }); }); </script> how can show div moment , after switch default div #red @ button click? neec badly. thanks!
if set duration .hide( [duration ] [, complete ] ) method, it'll placed in fx queue , delay work:
you should
stop()previous animation better handling multiple clicks btw
$(document).ready(function (){ $('#btnchange').click(function () { $('#red').hide(); $('#blue')/*.stop()*/.show().delay(1500).hide(0); $('#red').show(); }); }); with .stop():
Comments
Post a Comment