javascript - Delay in function calling -


the code is:

settimeout(function () {     $(id_lastchild).click();     $("#upload_download_doc").hide(); }, 150); settimeout(function () {     $(id_lastchild).click();     $("#upload_download_doc").hide(); }, 100); 

but want above in function like

function click_hide_scroll(){     $(id_lastchild).click();     $("#upload_download_doc").hide(); } 

implementation looking is

delay(100).click_hide_scroll().delay(100).click_hide_scroll();

that means after 100ms delay call click_hide_scroll() function , after completion of , 100ms delay, call function again.

is possible? or there other code this?

try callback()

function callagain(){     $(id_lastchild).click();     $("#upload_download_doc").hide(); }  function click_hide_scroll(callback){         $(id_lastchild).click();         $("#upload_download_doc").hide();         settimeout(callback, 100); }  settimeout(function() { click_hide_scroll(callagain)}, 100); 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -