2011-12-30 2 views
0

style="display:none"으로 설정된 모든 divs을 찾고 style="display:block"으로 변경해야합니다.jQuery show all elements를 다시 표시합니다.

나는 내가 다음 child elementswidth을 확인할 수 있습니다이 작업을 수행 할 필요가 다음 나는 하나 개의 요소하지만 난에 클릭 또는 다른 이벤트 떨어져이 작업을 수행하는 방법을 알고 style="display:none"

에 다시 설정할 수 있습니다 모든 숨겨진 요소에 page load으로 보내고 싶습니다.

위의 사항에 대한 도움이 될 것입니다.

감사합니다.

+0

얼마나 많은 요소를 확인할 찾고 있습니다? 모든 div를 클래스에 부여하면 특정 클래스의 모든 div를 반복 할 수 있습니다. –

답변

4
$(document).ready(function() { 
    $('div:hidden').each(function() { 
     $(this).show(); 
     //Do your calculations on the children... 
     $(this).hide(); 
    }); 
}); 

또는

$(document).ready(function() { 
    $('div:hidden').show('5', function() { 
     //Do your calculations on the children... 
     $(this).hide(); 
    }); 
}); 
+0

맨 위 하나가 나에게 도움이되었습니다. 감사합니다 – Sequenzia

+0

당신을 환영합니다! 내가 너를 도왔다 니 기쁘다. :) – Jules

1
$(document).ready(function() { 
    $('div:not(:visible)').show(); 
} 

보이지 않는 div를 모두 찾아 문서 준비 이벤트가 발생할 때 표시하십시오.

0

당신은 당신의 이벤트를 해고 할 문서 준비 이벤트를 사용할 수 있습니다

$(document).ready(function() { 
    var set = $("div:hidden"); 
    set.show(); // shows all hidden divs 
}