SearchRecent posts
The Random ToolboxDrupal 7 Setting up variables for use in a template (preprocess and process functions) Rendering Drupal 7 fields (the right way) Linux Secure Copy (scp) command Restrict Free Shipping in Magento Quickbooks Text Connection Ticket Cross-Site Request Forgery (CSRF) jQuery Events: MouseOver / MouseOut vs. MouseEnter / MouseLeave Monthly archive
|
setInterval() and clearInterval() Examplevar t; function show_uploaded_logo() { if($('div.form-item div.image-widget div.image-preview img').is('*')) { // use console.log to test that the function has stopped running //console.log('running'); if(!$('img#step-1-preview-image').is('*')) { //code here } else { clearInterval(t); } } } t = setInterval(show_uploaded_logo,1000); |