Pages

December 26, 2014

Collapse pageBlockSection on page load

Hi Friends,

It is very often situation where we want to collapse a section on visualforce page while loading the page to hide some part/information on page. It is very easy in visualforce by using a line of javascript code. Use below code and that's it, you are done.

<apex:pageBlockSection title=" Section Title " id="section1">

<Script> twistSection(document.getElementById("{!$Component.section1}").childNodes[0].childNodes[0]);

</script>

</apex:pageBlockSection>


Thanks