javascript - JQuery-ui, auto hide dialog -


i have dynamic element converted dialog widget. want disappear automatically.

this code not working.

$("<div>...</div>").dialog({   open : function(eve, ui) {     var item = this;     window.settimeout(function(item) {       item.dialog('close')       },      6000);   } }); 

couple problems - selector looked wrong.. also, trying pass "item" settimeout overwriting item = this.. $(this) meant setting item=this;

 $("div").dialog({   open : function(eve, ui) {    var item = $(this);      window.settimeout(function() {        item.dialog('close');      },       6000);   } }); 

heres quick fiddle: http://jsfiddle.net/jfit/qzggc/


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -