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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -