
jquery
郭浩326
这个作者很懒,什么都没留下…
展开
-
jQuery UI插件sortable中文帮助文档
所有的事件回调函数都有两个参数:event和ui,浏览器自有event对象,和经过封装的ui对象ui.helper - 表示sortable元素的JQuery对象,通常是当前元素的克隆对象ui.position - 表示相对当前对象,鼠标的坐标值对象{top,left}ui.offset - 表示相对于当前页面,鼠标的坐标值对象{top,left}ui.item - 表示当前拖拽的元素u...原创 2020-05-06 15:14:26 · 764 阅读 · 0 评论 -
jquery new FormData 上传文件 简单方法
$.ajax({ url:"接口地址", type:"post", data:new FormData($("#myForm")[0]), cache: false, processData: false, // jQuery不要去处理发送的数据 contentType: fals...原创 2020-03-12 10:36:07 · 865 阅读 · 0 评论 -
jquery 判断点击对象是否在元素内部
<div class="box2"> <div class="inbox" style="height: 80px;background: #eee;">4</div></div>$(document).on('click',function(e) { console.log($(e.原创 2019-01-10 14:08:24 · 1942 阅读 · 0 评论 -
jquery 判断当前点击不是当前
$( document ).on("click", function( e ) { if($(e.target).closest('.input-select-div').length <= 0){ $('.input-select-option').hide(); }});原创 2018-10-22 16:47:33 · 1430 阅读 · 0 评论 -
对html标签的offsetWidth、clientWidth、scrollWidth属性的理解
如果是用jquery 操作 请用 $(".box")[0].clientHeight; 或$("#box")[0].offsetWidth $(".box") 是选中 class 为box 的jquery对象 $(".box")[0] 是选中 class 为box 的dom对象 offsetWidth:元素内可见区域的宽度 + 元素边框宽度(如果有滚动...原创 2018-06-01 15:07:20 · 2943 阅读 · 0 评论 -
前端字符串拼接 优化栈内存
前端字符串拼接 优化栈内存原创 2017-10-18 10:27:15 · 344 阅读 · 0 评论 -
判断输入的内容为空(包含对内容全是空格的判断)
html>html>head> meta charset="UTF-8"> title>title> script src="https://cdn.bootcss.com/jquery/2.2.2/jquery.slim.js">script>head>body>input id="test" name="test" type="text" />div cl原创 2017-08-31 11:42:30 · 5108 阅读 · 0 评论 -
文字一行居中,两行增加省略号(不支持低版本浏览器)
html>html>head> meta charset="UTF-8"> title>title> script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.js">script>head>style type="text/css"> * { padding: 0; margin: 0; }原创 2017-08-31 00:17:10 · 299 阅读 · 0 评论 -
jQuery 浏览器之间跳转传递参数(支持中文字符)
one.htmlhtml>html>head> meta charset="UTF-8"> title>title> script src="https://cdn.bootcss.com/jquery/2.2.2/jquery.slim.js">script>head>body>input type="text" class="keyword"/>bu原创 2017-08-29 11:51:07 · 3173 阅读 · 0 评论 -
价格排序
html>html>head> meta charset="UTF-8"> title>title> script src="jquery-1.9.1.js">script> script> $.ajax({ url: 'data.json',//获取本地json数据,在同文件夹下 type: "g原创 2017-09-06 18:02:14 · 730 阅读 · 0 评论 -
$.each 使用方法
html>html>head> meta charset="UTF-8"> title>title> script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.js">script>head>input name="aaa" type="hidden" value="111" />input nam原创 2017-08-26 17:27:27 · 377 阅读 · 0 评论 -
尊重原创>> 在html中创建新标签和属性的方法
html>html lang="en">head> meta charset="UTF-8"> title>Titletitle> script src="https://cdn.bootcss.com/jquery/2.2.1/jquery.js">script>head>body><!--需要创建的标签这是一个链接-->script>/**第一种方转载 2017-08-25 11:58:59 · 781 阅读 · 0 评论 -
localStorage浏览器换肤
html>lang="en"> charset="UTF-8"> Title src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> *{ box-sizing: border-box; } body{原创 2017-07-26 17:09:18 · 637 阅读 · 0 评论 -
解决浏览器记住账户密码 运用readonly属性
html>lang="en"> charset="UTF-8"> Title src="jquery-1.11.0.min.js"> 请输入密码:class="password" type="password" readonly placeholder="请输入密码" /><!--*解决一些客户特殊要求,浏览器不再记录登录密码* 不用删除cook,运原创 2017-07-26 14:29:21 · 905 阅读 · 0 评论 -
localStorage换肤 简易版
html>lang="en"> charset="UTF-8"> Title src="jquery-2.0.2.js"> *{ margin: 0px; padding: 0px; } .bigbox{ display: none;原创 2017-08-03 15:54:50 · 514 阅读 · 0 评论 -
文字超过1行、2行或者规定的行数,文字自动加省略号
html>lang="en"> charset="UTF-8"> Title src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> type="text/javascript"> $(function () { $(".figcaption").each(原创 2017-07-26 10:54:13 · 526 阅读 · 0 评论