Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pixelToPoint = function(point, zoom, center, bounds) { | |
// 像素到坐标 | |
if (!point) { | |
return | |
} | |
var zoomUnits = getZoomUnits(zoom); | |
var mercatorLng = center.lng + zoomUnits * (point.x - bounds.width / 2); | |
var mercatorLat = center.lat - zoomUnits * (point.y - bounds.height / 2); | |
var mercatorLngLat = {lng: mercatorLng, lat: mercatorLat}; | |
return mercatorToLngLat(mercatorLngLat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Vertically centring in css</title> | |
<style> | |
.imgbox{display:table-cell; width:200px; height:200px; text-align:center; vertical-align:middle; *display:block; *position:relative; margin:20px auto;border:1px solid #ccc;} | |
.imgbox div{margin:0; *position:absolute; *top:50%; *left:50%;} | |
.imgbox div img{vertical-align:middle; *position:relative; *top:-50%; *left:-50%;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* MEDIA QUERIES */ | |
/** | |
* Print styles. | |
* | |
* Inlined to avoid required HTTP connection: www.phpied.com/delay-loading-your-print-css/ | |
*/ | |
@media print { | |
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; | |
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> <!-- HTML5 doctype 不区分大小写 --> | |
<html lang="zh-cmn-Hans-CN"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa --> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- 优先使用IE最新版本和 Chrome --> | |
<meta name="renderer" content="webkit|ie-comp|ie-stand"> <!-- 360 浏览器内核控制 --> | |
<!-- | |
content的取值为webkit,ie-comp,ie-stand之一,区分大小写,分别代表用webkit内核,IE兼容内核,IE标准内核。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh-cn"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>兼容IE6/IE7/IE8/火狐---下拉菜单select样式兼容</title> | |
<style type="text/css"> | |
body {background-color:#6C6;} | |
.sel-wrap{width:88px;height:29px;*background:#fff;background:#fff;*border:1px solid #b2b2b2;*padding:4px;*height:20px;} | |
.sel-inner{*border:0;*position:relative;*height:18px;*overflow:hidden;} | |
.so-sel{border:1px solid #b2b2b2;padding:4px 3px;font-size:12px;height:30px;width:89px;*width:88px;*margin:-1px;outline:none;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insertText(obj,str) { | |
if (document.selection) { | |
var sel = document.selection.createRange(); | |
sel.text = str; | |
} else if (typeof obj.selectionStart === 'number' && typeof obj.selectionEnd === 'number') { |