随笔分类 -  JS / jQuery插件

自己编写的或收藏的JS/jQuery插件代码
摘要:C.js代码: /** * 有BUG */ (function (global) { var _id; var _map; var _length; global.C = function () { _map = {}; _length = 0; }; global.C.prototype = { 阅读全文
posted @ 2021-09-12 00:39 0611163 阅读(138) 评论(0) 推荐(0) 编辑
摘要:按网上的思路一般要写双层循环,第一层循环遍历点集合,时间复杂度为O(N),第二层循环遍历结果集,逐一计算距离,距离小于阈值的不加入结果集,距离大于阈值的加入结果集,时间复杂度为O(M),双层循环总时间复杂度为O(N * M)。 新的算法思路:坐标点的经纬度经过计算得到的结果作为HashMap的Key 阅读全文
posted @ 2021-09-10 14:19 0611163 阅读(845) 评论(0) 推荐(1) 编辑
摘要:HashMap代码(这种实现方式是错误的,错误原因:代码中_map、_length变量是HashMap的所有实例共用的): /** * HashMap * 2021年09月09日 */ (function (global) { var _map; var _length; global.HashMa 阅读全文
posted @ 2021-09-09 18:38 0611163 阅读(591) 评论(0) 推荐(0) 编辑
摘要:前台代码: @using Models; @{ Layout = "~/Views/Shared/_Layout.cshtml"; } <link type="text/css" href="~/Scripts/zTree/css/zTreeStyle/zTreeStyle.css" rel="st 阅读全文
posted @ 2016-04-06 16:44 0611163 阅读(390) 评论(0) 推荐(0) 编辑
摘要:zDialog插件网址:http://www.jq22.com/jquery-info2426 再次封装zDialog的代码:(function ($) { $.extend({ iDialog: function (param) { var diag... 阅读全文
posted @ 2016-01-13 23:12 0611163 阅读(1592) 评论(0) 推荐(0) 编辑
摘要:错误的写法://打印function printPage(areaId) { if (parent.$("#PrinFrame").length == 0) { parent.$("body").append(''); } var prinFrame = parent... 阅读全文
posted @ 2015-09-18 15:40 0611163 阅读(1115) 评论(0) 推荐(0) 编辑
摘要:一、引用CSS和JS:View Code二、HTML: View Code三、创建编辑器对象:var ue;$(function () { $(function () { ue = UE.getEditor('ueditor', { maximumWords... 阅读全文
posted @ 2015-06-08 13:05 0611163 阅读(534) 评论(0) 推荐(0) 编辑
摘要:一、引用CSS和JS:View Code二、HTML:View Code三、JS:$(function () { var total = parseInt("@(ViewBag.total)"); var page = parseInt("@(ViewBag.page)") - 1; ... 阅读全文
posted @ 2015-06-08 12:48 0611163 阅读(373) 评论(0) 推荐(0) 编辑
摘要:由于是触摸屏,所以需要一款JS虚拟键盘。上网找了一个好用的VirtualKeyboard,作了修改。 修改该插件参考的博客文章:http://www.cnblogs.com/xinggong/archive/2013/02/07/2908534.html 下载链接:JS虚拟键盘Virtual... 阅读全文
posted @ 2015-02-28 10:33 0611163 阅读(1157) 评论(0) 推荐(1) 编辑
摘要:JS数字键盘,JS小键盘CSS代码:#numberkeyboard{ border: 1px solid #b3b3b3; background: #f2f3f7; height: 285px; margin: 0; padding: 2px; position:... 阅读全文
posted @ 2015-02-28 09:47 0611163 阅读(854) 评论(0) 推荐(0) 编辑
摘要:HTML的select控件美化CSS:.div-select{ border: solid 1px #999; height: 40px; line-height: 40px; cursor: default;}.div-select-text{ float: left... 阅读全文
posted @ 2015-02-08 22:28 0611163 阅读(3198) 评论(2) 推荐(1) 编辑
摘要:工具类定义:/*** 日期范围工具类*/var dateRangeUtil = (function () { /*** * 获得当前时间 */ this.getCurrentDate = function () { return new Date(); }... 阅读全文
posted @ 2014-06-06 09:19 0611163 阅读(1459) 评论(0) 推荐(1) 编辑
摘要:// 对Date的扩展,将 Date 转化为指定格式的String // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) // 例子: // (... 阅读全文
posted @ 2014-06-06 09:12 0611163 阅读(399) 评论(0) 推荐(0) 编辑
摘要:一、节点模糊搜索功能:搜索成功后,自动高亮显示并定位、展开搜索到的节点。二、节点异步加载:1、点击展开时加载数据;2、选中节点时加载数据。前台代码如下:View Code View Code后台代码(后台返回Json数据): public void SelStudent() { set("getStudentsJsonUrl", to(GetStudentsJson)); } public void GetStudentsJson() { ... 阅读全文
posted @ 2014-03-04 21:25 0611163 阅读(1069) 评论(0) 推荐(0) 编辑