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
| @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
| <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 () { | |
| 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
| ;(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
| //改自: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
| /** | |
| * 比例尺寸计算 | |
| * | |
| * @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
| class Checker { | |
| /** | |
| * 生成一个 checker | |
| * @param context 是一个object,跟itemKey配合得到items | |
| * @param itemKey context中的items的key | |
| * @param idKey 用于匹配的值 | |
| * @example | |
| this.checker = new Checker({ | |
| context: this, | |
| itemKey: 'items', |
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
| $.fn.marquee = function (options) { | |
| var $that = this | |
| var that = this[0] | |
| if (!that) return | |
| options = $.extend({}, { | |
| speed: 50 | |
| }, options) | |
| var timer = setInterval(marquee, options.speed) |
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
| <!doctype html> | |
| <html lang="zh-cn"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="demo.css"> | |
| <!--<script src="index.js"></script>--> | |
| </head> | |
| <style> |