其实是很简单的display的效果。。

  1. function disBlock(str,str2){
  2. var str=document.getElementById("c"+str);
  3. var p=document.getElementsByClassName("question");
  4. if (str.style.display !="block"){
  5. for ( i=1;i<9;i++ ){
  6. str3=i+"";
  7. str3="c"+str3;
  8. document.getElementById(str3).style.display="none";
  9. }
  10. for (i=0;i<p.length;i++){
  11. p[i].childNodes[0].style.fontWeight="400";
  12. p[i].childNodes[0].style.color="#fff";
  13. }
  14. str2.childNodes[0].style.fontWeight = "700";
  15. str2.childNodes[0].style.color="#FFE38C";
  16. str.style.display ="block";
  17. }else{
  18. str2.childNodes[0].style.fontWeight = "400";
  19. str2.childNodes[0].style.color="#fff";
  20. str.style.display ="none";
  21. }
  22. }

 

无觅相关文章插件,快速提升流量