This file contains hidden or 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
/** | |
* 比例尺寸计算 | |
* | |
* @param options | |
* @param options.w | |
* @param options.h | |
* @param [options.newW] | |
* @param [options.newH] | |
* @param [options.max] | |
* @returns {object} |
This file contains hidden or 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
//改自:http://blog.csdn.net/aimingoo/article/details/4492592 | |
var len = ('' + num).length; | |
return (Array( | |
fill > len ? fill - len + 1 || 0 : 0 | |
).join(0) + num); |
This file contains hidden or 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 (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD | |
define([], factory) | |
} else if (typeof exports === 'object') { | |
// Node, CommonJS | |
module.exports = factory() | |
} else { | |
// Window | |
root.collisionChecker = factory() |
This file contains hidden or 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 () { | |
function Pointer(x, y) { | |
this.x = x; | |
this.y = y; | |
} | |
function Position(left, top) { | |
this.left = left; | |
this.top = top; | |
} |
This file contains hidden or 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
<script> | |
// 放在body内 | |
if (navigator.userAgent.toLowerCase().indexOf("applewebkit/") < 0) { | |
var html = '\n<div style="position: absolute; width: 100%;height: 100%; z-index: 1000000;">\n \n <div style="\n background: #FFF3E1;\n padding: 20px;\n text-align: center;\n font-size: 15px;\n position: relative;\n z-index: 1000;\n color: #777;">\n <span style="color:#FF9800; ">▶</span> 很抱歉,无线编辑器暂不支持您的浏览器内核,请您\n <a style="color: #2196F3;"\n href="http://chrome.360.cn/test/core/">升级浏览器</a>\n 后再使用。\n </div>\n \n <div style="background: #eee;position: absolute;width: 100%;height: 100%;z-index: 10000;opacity: .7;"></div>\n</div>'; | |
document.body.innerHTML = html | |
} | |
</script> |
This file contains hidden or 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 spaceBetween($itemPx, $itemCount, $wrapPx:750) { | |
@return #{(100 - $itemPx / $wrapPx * 100 * $itemCount) / ($itemCount + 1) + "%"}; | |
} |
This file contains hidden or 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
/** | |
* 新窗口打开,并写入内容 | |
* @param html | |
*/ | |
function openWinHtml(html) { | |
let newWindow = window.open("", "newwin"); | |
newWindow.document.write(html) | |
newWindow.document.close() | |
} |
This file contains hidden or 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
/** | |
* 根据obj的path获得数据 | |
* @param obj {Object} | |
* @param path {String} | |
* @returns {*} | |
*/ | |
function getValueOfPath(obj, path) { | |
var pathArray = path.split('.') | |
var currentPath = pathArray.shift() |
This file contains hidden or 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
export default angular.module('dtcloud.directive.pager', []) | |
.factory('Pager', PagerFactory) | |
.directive('pager', PagerDirective) | |
/** | |
* 生成一个适用于 PagerDirective 的对象结构 | |
* @returns {Pager} | |
* @constructor | |
*/ |
This file contains hidden or 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
var s = '123456'; | |
function reverse (s) { | |
let _s = [...s]; | |
return s ? _s.pop() + reverse(_s.join('')) : ''; | |
} | |
reverse(s); |