You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
595 B

/**
* 常用组件库
*
**/
/* 网站右下角悬浮常用组件 */
function Fixed() {
this.fixed = null
this.setting = {
type: '1',
colorStyle: 'blue'
}
}
// 初始化
Fixed.prototype.init = function(opt){
extend(this.setting, opt)
this.create()
}
// 创建元素
Fixed.prototype.create =function(){
this.fixed = document.createElement('div')
this.fixed.className = 'conponent_fixed'
this.fixed.innerHTML = '<p>123</p>'
document.body.appendChild(this.fixed)
}
function extend(defaultVal, newVal) {
for(var e in newVal) {
defaultVal[e] = newVal[e]
}
}