javascript - Refreshing DOM between click events -
i have click event:
$('#undoall').click(function(){ $('#prospecttable tbody tr td a:not(.invisible)').each(function(){ $(this).trigger('click'); }) });
which calls individual click events.
the inner click events in above code make changes dom. these changes appear after each individual inner click event user can see things happening (the outer click event can take 30 seconds complete).
unfortunately, no changes dom made until click events processed.
is there can force dom refresh after each inner click?
any appreciated.
after many hours of experimenting following seems achieve precisely desired effect.
$('#undoall').click ( function() { if($('#prospecttable tbody tr td a:not(.invisible)').length > 0) { $('#prospecttable tbody tr td a:not(.invisible)').first().click(); settimeout ( function() { $('#undoall').click(); }, 1 ); }; } );
the issue appears there no redrawing or refreshing of dom until click event complete. settimeout allows 1 click event end (allowing redraw) while setting another.
Comments
Post a Comment