javascript - Getting wrong length on dialog -
i'm working jquery , i'm trying listen how may there open after close dialog, i'm getting how many open. example: if have 4 , close 1 returns 4 when expect 3, , @ end when have 1 open returns 2, , @ end when close last 1 return 1.
am doing right? try in docs , try afterclose there not.
$( ".test" ).dialog({ autoopen: false, height: "auto", width: "auto", modal: true, close: function(e){ $(this).destroy(); // returns wrong lenght console.log($('.test').length); if($('.test').length === 1) { console.log($('.test a').text()); } } });
how getting numbers? unless destroying dialogs calling
$('.test').length
is going return number of classes of test on dom. using .remove() or remove dialogs? more information needed.
when close dialog not remove dom. hides it, can see hidden html @ bottom of page. proper way use multiple dialogs use instances of dialogs. shit complicated. post more of code, how setting html , if how deleting dialogs.
also (since cant comment yet), close event fires window closing before window hidden, allows 2 places cancel close event, beforeclose (typically validation), , close (maybe population of objects or something).
Comments
Post a Comment