From 5244da8f223a411b733405ca94d0c51fe0749c29 Mon Sep 17 00:00:00 2001 From: chuyuqiao Date: Fri, 27 Oct 2017 11:21:56 +0800 Subject: [PATCH 1/2] code snippets --- code snippets.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 code snippets.js diff --git a/code snippets.js b/code snippets.js new file mode 100644 index 0000000..6e077e4 --- /dev/null +++ b/code snippets.js @@ -0,0 +1,16 @@ +// ---------------------------------------------------------- +// 组件 +// ---------------------------------------------------------- +// 选择组件 +// Select2 4.0.3 +// 重置 +$('#mySelect2').val(null).trigger('change'); +// 多选返回为数组 +$('#mySelect2').val(); + +// 选择框取值 +$('#myselect option:selected').val(); +// 表单重置 +// -------------------------------------------------------- +// 性能优化 +// -------------------------------------------------------- From 084e8cabbbe0770cc8f41bc6db1e8cae9d39a0aa Mon Sep 17 00:00:00 2001 From: chuyuqiao Date: Thu, 9 Nov 2017 14:07:04 +0800 Subject: [PATCH 2/2] update codeSnippets.js --- code snippets.js | 76 +++++++++++++++++++++++++++++++++++++++ codeSnippets.js | 92 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 codeSnippets.js diff --git a/code snippets.js b/code snippets.js index 6e077e4..e745cd0 100644 --- a/code snippets.js +++ b/code snippets.js @@ -11,6 +11,82 @@ $('#mySelect2').val(); // 选择框取值 $('#myselect option:selected').val(); // 表单重置 +//表单事件绑定 +table.unbind("click"); +table.on('click', '.detail', function() {}); +// DataTables + + +jQuery.validator.addMethod("tagCodeParentCheck", function (value, element) { + return tagCodeParentCheck(value); +}, "请选择标签大类!"); + + +$('#sdbussInfluence input[name=bussInfluence]:checked').val() + +$('#sdbussInfluence input[name=bussInfluence]') + +// 展开关闭 +var g = [' 32) { + g = g.concat(['class="hide toggle">',data, + '收起↑
', + data.substr(0, 32),'...展开↓
']); +} else { + g = g.concat([ '>', data, '' ]); +} +return g.join(''); + +table.on('click', '.expandCollapseBtn', function() { + $(this).closest('td').children('.toggle').toggleClass('hide'); +}); +//js True和False +// JavaScript把null、undefined、0、NaN和空字符串''视为false,其他值一概视为true,因此上述代码条件判断的结果是true。 +//开关切换按钮 +/*遮罩*/ +// .rel { +// position: relative; +// } + +// .overlay { +// position: absolute; +// width: 100%; +// height: 100%; +// top: 0; +// left:0; +// background: rgba(255,255,255,0.3); +// z-index: 50; +// } + +// .overlay > .fa { +// position: absolute; +// top: 50%; +// left: 50%; +// margin-left: -15px; +// margin-top: -15px; +// color: #20c5ad; +// font-size: 30px; +// line-height: 1; +// } + +// .nowrap { +// white-space: nowrap; +// } + +// @media (min-width: 992px) { +// .sm-only { +// display: none; +// } +// } +
+ +
+ + +
+
// -------------------------------------------------------- // 性能优化 // -------------------------------------------------------- diff --git a/codeSnippets.js b/codeSnippets.js new file mode 100644 index 0000000..9f21928 --- /dev/null +++ b/codeSnippets.js @@ -0,0 +1,92 @@ +// ---------------------------------------------------------- +// 组件 +// ---------------------------------------------------------- +// 选择组件 +// Select2 4.0.3 +// 重置 +$('#mySelect2').val(null).trigger('change'); +// 多选返回为数组 +$('#mySelect2').val(); + +// 选择框取值 +$('#myselect option:selected').val(); +// 表单重置 +//表单事件绑定 +table.unbind("click"); +table.on('click', '.detail', function() {}); +// DataTables + + +jQuery.validator.addMethod("myCheck", function (value, element) { + return myCheck(value); +}, "this can not be null!"); + + +$('#myId input[name=myName]:checked').val() + +$('#myId input[name=myName]') + +// 展开关闭 +var g = [' 32) { + g = g.concat(['class="hide toggle">',data, + '收起↑
', + data.substr(0, 32),'...展开↓
']); +} else { + g = g.concat([ '>', data, '' ]); +} +return g.join(''); + +table.on('click', '.expandCollapseBtn', function() { + $(this).closest('td').children('.toggle').toggleClass('hide'); +}); +//js True和False +// JavaScript把null、undefined、0、NaN和空字符串''视为false,其他值一概视为true,因此上述代码条件判断的结果是true。 +//开关切换按钮 +/*遮罩*/ +// .rel { +// position: relative; +// } + +// .overlay { +// position: absolute; +// width: 100%; +// height: 100%; +// top: 0; +// left:0; +// background: rgba(255,255,255,0.3); +// z-index: 50; +// } + +// .overlay > .fa { +// position: absolute; +// top: 50%; +// left: 50%; +// margin-left: -15px; +// margin-top: -15px; +// color: #20c5ad; +// font-size: 30px; +// line-height: 1; +// } + +// .nowrap { +// white-space: nowrap; +// } + +// @media (min-width: 992px) { +// .sm-only { +// display: none; +// } +// } +
+ +
+ + +
+
+// -------------------------------------------------------- +// 性能优化 +// --------------------------------------------------------