var not_0_width = {}; self.element.closest(':parent').each(function(){ if($(this).width()>0){ not_0_width = $(this); return } });