想要在超小屏幕和小屏幕显示两列,在中屏幕和大屏幕显示三列, 三个div的class写法如下
<div class='row'>
<div class="col-xs-6 col-md-4">1</div>
<div class="col-xs-6 col-md-4">2</div>
<div class="col-xs-6 col-md-4">3</div>
</div>
浏览器加载完成运行事件
window.onload(){}
var x = 11;
function fn(x) {
console.log(x);
x = 10;
console.log(x);
arguments[0] = 20;
console.log((x));
}
fn(2);
console.log(x);
//输出结果 2 10 20 11
function fun(n, o) {
console.log(o);
return {
fun: function (m) {
return fun(m, n);
}
}
}
var a = fun(0); a.fun(1); a.fun(2); a.fun(3);
var b = fun(0).fun(1).fun(2).fun(3);
var c = fun(0).fun(1);
c.fun(2);
c.fun(3);
/*打印结果 undefined 0 0 0
undefined 0 1 2
undefined 0 1 1
*/
Class类练习
编写一个动物类,该类包含name的属性,和say的方法。 通过say方法可以打印动物说话了。编写一个Dog类继承动物类,要求该类中包含颜色的属性,该类重写say方法,要求打印父类的say方法里的内容,并且打印 动物颜色+动物名字+“叫了”
class Animal {
constructor(name){
this.name = name;
}
say(){
console.log("动物说话了")
}
}
class Dog extends Animal {
constructor (name,color){
super(name)
this.color = color
}
say(){
super.say()
console.log(this.color+this.name+"叫了")
}
}
const dog = new Dog("毛毛","金色")
dog.say()
offset系列
offsetHeight : 本身的高度 + 上下边框 + 上下内边距
offsetWidth : 本身的宽度 + 左右边框 + 左右内边距
offsetWidth : 本身的宽度 + 左右边框 + 左右内边距
offsetLeft : 父元素没有定位时 :子元素到浏览器左侧的距离 (父元素的左外边距+父元素的左边框+子元素的左外边距)
父元素有定位时 : 子元素到父元素左侧的距离 (子元素的左外边距)
offsetTop : 父元素没有定位时 :子元素到浏览器上侧的距离 (父元素的上外边距+父 元素的上边框+子元素的上外边距)
父元素有定位时 : 子元素到父元素上侧的距离 (子元素的上外边距)
client 系列 :
clientHeight : 本身的高度 + 上下内边距
clientWidth : 本身的宽度 + 左右内边距
clientLeft : 左侧边框
clientTop : 上边框
scroll 系列 :
scrollHeight : 本身的高度 + 滚动条卷曲的长度
scrollWidth : 本身的宽度 + 滚动条卷曲的长度
scrollLeft : 滚动条卷曲X轴的长度
scrollTop : 滚动条卷曲Y轴的长度