您的位置:首页 > Web前端 > JavaScript

js

2015-09-28 15:53 387 查看
;(function(win, lib) {
var doc = win.document
var docEl = doc.documentElement
// 可能放在head获取不到body

})(window, window['lib'] || (window['lib'] = {}));

console.warn('将根据已有的meta标签来设置缩放比例');
console.info('1\n2\n')


void function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory)
} else if (typeof exprots === 'object') {
factory(require('jquery'))
} else {
factory(jQuery)
}
}(function($) {
console.log($)
function Person = function() {}
return Person
});

void function(root, factory) {
if (typeof module !== 'undefined' && module.exports) {
module.exports = factory()
} else if (typeof define === 'function' && define.amd) {
define(factory)
} else {
root.A = factory.call(root)
}
}(this, function() {
function Person = function() {}
return Person
});






参数处理





获取伪元素属性

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
#box:before {
content: 'jj';
color: red;
}
</style>
</head>
<body>
<div id="box"></div>
<script>
var style = window.getComputedStyle(document.querySelector('#box'), ':before')
var color = style.getPropertyValue('color')
var content = style.getPropertyValue('content')
console.log(color)
console.log(content)
</script>
</body>
</html>


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: