发表于: 2018-08-09 22:22:06
2 554
今天完成的事情:解决任务九页面二和三汉堡包导航点击后再次点击不会缩回去的问题。
明天的计划:继续任务十吧。
遇到的问题:任务九没通过的原因是点击导航不会缩回去,百度过,自己也尝试用chrome开发者工具去看,我自己估计是header和footer的js文件估计会有点问题,解决的办法是把不需要的东西都删掉,留下有用的,我原来的header.js文件挺长的,就是一个独立的html页面直接转js的。现在改成去掉头和尾部,只保留中间div部分如下:
document.writeln("<div>");
document.writeln("<div class=\'container-fluid box12\'>");
document.writeln(" <div class=\'container\'>");
document.writeln(" <div class=\'box12-a\'>");
document.writeln("");
document.writeln(" <div class=\'box12-aa box12-a1\'>");
document.writeln(" <br>技能树 — 改变你我");
document.writeln(" <br>");
document.writeln(" <br>");
document.writeln("");
document.writeln(" <br> 关于我们 | 联系我们 | 合作企业");
document.writeln(" </div>");
document.writeln(" <div class=\'box12-aa box12-a2\'>");
document.writeln(" <br>旗下网站");
document.writeln(" <br>");
document.writeln(" <br><em class=\'gg\'>草船云孵化器</em> 最强IT特训营");
document.writeln(" <br>");
document.writeln(" <br>葡萄藤轻游戏 桌游精灵");
document.writeln(" </div>");
document.writeln("");
document.writeln(" <div class=\'box12-aa box12-a3\'>");
document.writeln(" <div class=\'box12-tt\'>");
document.writeln(" <br>微信公众平台");
document.writeln(" <div class=\'codebar\'></div>");
document.writeln(" </div>");
document.writeln(" </div>");
document.writeln(" </div>");
document.writeln(" </div>");
document.writeln("</div>");
document.writeln("<div class=\'footer\'>Copyright©2015技能树 www.jnshu.com All Rights Reserved 京ICP备13005880号</div>");
document.writeln("");
document.writeln("</div>");
可以看到,我的js文件下面这个页面头部的一些东西都删掉了。
收获:header和footer部分用js引用。
评论