在获取最小高度的box时 代码可以简化 var minH = var minH=hArr.sort()[0];
2018-11-08
跟着老师做的demo:https://niuyi1017.github.io/imooc/%E7%80%91%E5%B8%83%E6%B5%81%E5%B8%83%E5%B1%80/index.html
源码:https://github.com/niuyi1017/imooc/tree/master/%E7%80%91%E5%B8%83%E6%B5%81%E5%B8%83%E5%B1%80
欢迎和大家一起交流学习~
源码:https://github.com/niuyi1017/imooc/tree/master/%E7%80%91%E5%B8%83%E6%B5%81%E5%B8%83%E5%B1%80
欢迎和大家一起交流学习~
2018-10-12
我觉得这段代码还需要改进,我做响应式网站的时候,这段代码就有错误了,在判断if( index < num )的时候如果true就清除style,false的话就添加style这样才对
2018-06-04
function getByClass(clsName, parent){
//定义函数getByClass()实现获取document或指定父元素下所有class为on的元素
var oParent=parent?document.getElementById(parent):document
var boxArr=oParent.querySelectorAll(clsName);
console.log(boxArr)
return boxArr;
}
//定义函数getByClass()实现获取document或指定父元素下所有class为on的元素
var oParent=parent?document.getElementById(parent):document
var boxArr=oParent.querySelectorAll(clsName);
console.log(boxArr)
return boxArr;
}