What am I doing wrong here? It looks like my .delay is not working:
$(document).ready(function() {
var imgsrc = "#WORKSPACE_IMAGES#spinner_big.gif";
$('a#add-node').click(function() {
$('a#add-node').hide();
$('#form-loading').show().delay(5000);
$('#form-loading').hide()
$('a#add-node').show();
});
});
I basically would like to display my form-loading div, wait 5 seconds, then hide it and then display my other add-node div.
When I press on my button, noting seems to happen, it just shows my original add-node div button.
Instead of
you should do
Taken from documentation:
Anyway if nothing happens, it seems like your event is not attached correctly. Post the markup to or a fiddle so that we can help
EDIT – i read the documentation a little better:
So you cant use delay with show() and hide(); The you have to use setTimeout() i guess:
fiddle: http://jsfiddle.net/qUD7U/1/