Red de conocimiento informático - Aprendizaje de código fuente - Abra el código fuente del complemento de menú

Abra el código fuente del complemento de menú

ltstyle gt

/*Crea tu propio estilo*/

. ¿padres? . sub{pantalla:? Ninguno;}

lt/style gt;

ltul? class="padre "

ltLi? class="pli "

ltspan gtphp lt/spangt.

¿ltul? class="son " >>p>

lt李gtPHP 1 lt;/李gt

lt李gtPHP 1 lt;/李gt

lt/ul gt;

lt/李gt

lt李? class="pli "

ltspan gtphp lt/spangt.

¿ltul? class="son " >>p>

lt李gtPHP 1 lt;/李gt

lt李gtPHP 1 lt;/李gt

lt/ul gt;

lt/李gt

lt李? class="pli "

ltspan gtphp lt/spangt.

¿ltul? class="son " >>p>

lt李gtPHP 1 lt;/李gt

lt李gtPHP 1 lt;/李gt

lt/ul gt;

lt/李gt

lt李? class="pli "

ltspan gtphp lt/spangt.

¿ltul? class="son " >>p>

lt李gtPHP 1 lt;/李gt

lt李gtPHP 1 lt;/李gt

lt/ul gt;

lt/李gt

lt李? class="pli "

ltspan gtphp lt/spangt.

¿ltul? class="son " >>p>

lt李gtPHP 1 lt;/李gt

lt李gtPHP 1 lt;/李gt

lt/ul gt;

lt/李gt

lt/ul gt;var? ¿pli? =?document.querySelectorAll(".parent?.pli?span");

for(var?i?=?0;iltpli.length;i){

pli [ i]. ¿índice? =?i;

pli[i]. al hacer clic? =?function(){

for(var?j?=?0;j ltpli.length;j){

document.querySelectorAll(".parent?.pli?. son ")[j]. style . display = " none ";

}

this.parentNode.querySelector(". son "). style . display = " block ";

}

}