When a dialog is initialized it is appended to the end of the body, because of an IE6 stacking issue. So it's no longer inside the .pane element. - Richard
2009/8/2 av3nger <anto...@gmail.com> > > When I try to animate a DIV-element with this code: > $(this).parents(".pane").animate({ backgroundColor: "#fbc7c7" }, > "fast") > .animate({ opacity: "hide" }, "slow") > > everything works fine. But when I try to do it after I press a button > in a dialog - nothing works! Why? > Here's the code: > $(document).ready(function(){ > > $("#dialog").dialog({ > bgiframe: true, > resizable: false, > height:140, > autoOpen: false, > modal: true, > overlay: { > backgroundColor: '#000', > opacity: 0.5 > }, > buttons: { > 'Удалить новость': function() { > $.get( > "news.php", > "act=delete&id="+id > ); > $(this).dialog('close'); > $(this).parents(".pane").animate({ > backgroundColor: "#fbc7c7" }, > "fast") > .animate({ opacity: "hide" }, > "slow") > return false; > }, > 'Отмена': function() { > $(this).dialog('close'); > return false; > } > } > }); > > $(".pane .btn-delete").click(function(){ > id = $(this).parents('.pane').find('td:first').attr('id'); > $("#dialog").dialog('open'); > return false; > }); > }); >