help me this, want make when click fade out , when after 3 seconds fade in.
<script type="text/javascript"> $(".controls_next2").click(linkbind); function linkbind(){ var $this = $(this); $this.addclass('disabled'); $this.unbind('click'); settimeout(function() { $this.removeclass('disabled'); $this.bind('click', linkbind); }, 3000); } $(document).on('click', '.disabled', function (e) { e.preventdefault(); }); </script>
you can use jquery's fadeout , fadein functions. can provide callback fadeout
function, use settimeout
wait 3 seconds , call fadein
.
function linkbind() { var $this = $(this); $this.addclass('disabled'); $this.off('click'); $this.fadeout(function () { settimeout(function () { $this.removeclass('disabled'); $this.on('click', linkbind); $this.fadein(); }, 3000) }); }
Comments
Post a Comment