随笔分类 -  jquery

摘要:webpack更新原理 每次改代码 除了直接改组件里面的东西 改引用的js store都会重新刷新页面 体验真心不好 阅读全文
posted @ 2022-05-13 10:34 newmiracle宇宙 阅读(20) 评论(0) 推荐(0) 编辑
摘要:jquery地区选择插件 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable= 阅读全文
posted @ 2020-03-03 13:32 newmiracle宇宙 阅读(1517) 评论(0) 推荐(0) 编辑
摘要:在项目中使用接口的比较多,在客户端跨域访问,jquery中只能使用jquery ajax的jsonp方法。 值得注意的是,jQuery.ajax()只支持get方式的跨域,post的方式是不支持的。<pre> <script type="text/javascript"> // 简写形式 $.get 阅读全文
posted @ 2019-11-17 12:37 newmiracle宇宙 阅读(134) 评论(0) 推荐(0) 编辑
摘要:在项目中使用接口的比较多,在客户端跨域访问,jquery中只能使用jquery ajax的jsonp方法。 值得注意的是,jQuery.ajax()只支持get方式的跨域,post的方式是不支持的。<pre> <script type="text/javascript"> // 简写形式 $.get 阅读全文
posted @ 2019-11-17 12:36 newmiracle宇宙 阅读(163) 评论(0) 推荐(0) 编辑
摘要:插件还是用 jquery.imgpreload.min.js 只不过初始化加载 必须用window.onload 图片dom都加载完成再显示 不然会有bug <pre> window.onload=function myalert(){//初始化diamante p1();}</pre> 接下来就不 阅读全文
posted @ 2019-11-17 08:14 newmiracle宇宙 阅读(729) 评论(0) 推荐(0) 编辑
摘要:jquery取消绑定的方法 一般用变量控制 不要用unbind() 相应比较慢 <pre> $('.choseitem').on('click', function () { //如果设置0 就是不能点 如果想什么时候能点 再把isclick设置为1 if(!isclick){ return fal 阅读全文
posted @ 2019-11-17 08:13 newmiracle宇宙 阅读(245) 评论(0) 推荐(0) 编辑
摘要:jquery关于移动端的点击事件解析 如果用click来写 你连续点几下 会没有反应 响应是非常慢的 所以移动端必须用touchstart代替click来写 阅读全文
posted @ 2019-11-16 19:39 newmiracle宇宙 阅读(1907) 评论(0) 推荐(0) 编辑
摘要:jquery插件实现瀑布流<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><style> .container-fluid { padding: 20px; } .box 阅读全文
posted @ 2019-11-16 19:10 newmiracle宇宙 阅读(129) 评论(0) 推荐(0) 编辑
摘要:jquery swipper插件的一些弊端touch触摸机制是swipper的 阻止click冒泡。拖动Swiper时阻止click事件。下面这个方法或许可以解决触摸机制的问题 <pre><div class="swiper-slide" onclick="alert('你点了Swiper')">< 阅读全文
posted @ 2019-11-16 17:27 newmiracle宇宙 阅读(233) 评论(0) 推荐(0) 编辑
摘要:jquery ajax分页写法我用的是laypage插件 前端代码<pre> function demo(curr) { $.getJSON('/home/index/getinfo', { page: curr || 1 //向服务端传的参数,此处只是演示 }, function (res) { 阅读全文
posted @ 2019-11-16 17:23 newmiracle宇宙 阅读(370) 评论(0) 推荐(0) 编辑
摘要:jquery关于on click事件的理解 <pre><a style="min-width:60px; margin-left:6px;" wenzhangid="'+v['id']+'" type="button" class="btn btn-w-m btn-danger deletewenz 阅读全文
posted @ 2019-11-16 17:23 newmiracle宇宙 阅读(214) 评论(0) 推荐(0) 编辑
摘要:jquery监听回车 <pre> $("#loginusername, #loginpassword, #code").keydown(function() { if(event.keyCode == "13"){ loginajax(); } });</pre> 只能在input 输入框 上监听到 阅读全文
posted @ 2019-11-16 13:21 newmiracle宇宙 阅读(937) 评论(0) 推荐(0) 编辑
摘要:jquery预加载显示百分比 <pre> <img class="bj loadimg" loadimg="/weiqingshu/images/1/bj.jpg"/></pre> <script type="text/javascript" src="/caigeci/js/jquery.imgp 阅读全文
posted @ 2019-11-16 13:20 newmiracle宇宙 阅读(431) 评论(0) 推荐(0) 编辑
摘要:移动端实现裁剪图片生成base64图片(可缩放)<pre><!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8" /> <title>{$title}</title> <meta name="viewport" content="wi 阅读全文
posted @ 2019-11-16 12:12 newmiracle宇宙 阅读(185) 评论(0) 推荐(0) 编辑
摘要:jquery json对象转换 <pre>//json数组转json串var arr = [1,2,3, { a : 1 } ];JSON.stringify( arr ); //json字符串转json数组var jsonStr = '[1,2,3,{"a":1}]';JSON.parse( js 阅读全文
posted @ 2019-11-15 12:20 newmiracle宇宙 阅读(3076) 评论(0) 推荐(0) 编辑
摘要:jquery鼠标经过弹出层写法<pre><div class="navitem"><a href="/index.php?c=news&amp;a=index&amp;id=52">新闻中心</a><div class="navitemlist" style="display: none;"><a 阅读全文
posted @ 2019-11-15 12:12 newmiracle宇宙 阅读(294) 评论(0) 推荐(0) 编辑
摘要:jquery向上滚动页面的写法<pre> $('.arrow_top').on('click',function () { $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : 阅读全文
posted @ 2019-11-15 12:12 newmiracle宇宙 阅读(418) 评论(0) 推荐(0) 编辑
摘要:jquery swiper自定义pagination的方法<pre><script>var swiper = new Swiper('.swiper-container', { pagination: '.swiper-pagination', paginationClickable: true, 阅读全文
posted @ 2019-11-15 12:11 newmiracle宇宙 阅读(1922) 评论(0) 推荐(0) 编辑
摘要:jquery trigger使用方法比方说写了下面点击事件 采用trigger 要触发他<pre> $('.biaoqian_ula').on('click',function () { $('.lianxi_nav img').css('border','1px #d6d6d6 solid'); 阅读全文
posted @ 2019-11-15 12:10 newmiracle宇宙 阅读(227) 评论(0) 推荐(0) 编辑
摘要:jquery on绑定事件叠加解决方法 代码如下 <pre> $('.maoqiu').each(function () { var is_bind = $(this).attr('is_bind'); if (is_bind != 1) { $(this).attr('is_bind', 1); 阅读全文
posted @ 2019-11-15 12:09 newmiracle宇宙 阅读(337) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示