Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Estado
subtletrue
titleSaiba mais

HTML
<div id="complementarInfo"> 
	<a id="toggleAll" href="#" >Expandir/ocultar informações complementares</a>
</div>
 <script type="text/javascript">
document.getElementById('complementarInfo').innerHtml = 'teste';
 AJS.toInit(function ()
 {
 AJS.$('#toggleAll').click(function()
 {
 var abertos = 0;
 var fechados = 0;
 jQuery(".expand-control").each(
	function(){ 
		if(document.getElementById(this.id).children[0].className != "expand-control-icon icon expanded"){
			fechados++;
		} else {
			abertos++;
		}
	}
 )
 if(abertos >= fechados){
 	jQuery(".expand-control").each(
		function(){ 
			if(document.getElementById(this.id).children[0].className == "expand-control-icon icon expanded"){
				jQuery(this).trigger("click");
			}
		}
 	)
 } else {
 	jQuery(".expand-control").each(
		function(){ 
			if(document.getElementById(this.id).children[0].className != "expand-control-icon icon expanded"){
				jQuery(this).trigger("click");
			}
		}
	 )
 }


 });
 });
 
 </script>

...