js
euxil97
全栈学习中
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
阻止事件冒泡和阻止浏览器默认行为
原生阻止事件冒泡 e=e||window.event; e.stopPropagation(); e.cancelBubble=true; 原生阻止浏览器默认行为 e=e||window.event; e.preventDefault(); e.returnValue=false; jquery阻止事件冒泡同时阻止浏览器默认行为return false;原创 2017-09-02 12:55:30 · 315 阅读 · 0 评论 -
连续点击会出现一片蓝色区域解决方法
添加css语句: body{ -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; } 或添加js语句: document.onselectstart=new Function("return false");原创 2017-09-02 19:49:50 · 749 阅读 · 0 评论 -
jquery中点击某元素后滚动条滚动到某元素位置或底部
//首先获取文档对象 var target; if(document.documentElement.scrollTop){ target=$("html"); }else{ target=$("body"); }//到某元素$("#nu").on("click",function(e){ e.preventDefault(); var timer=setInter原创 2017-08-14 20:16:47 · 6345 阅读 · 0 评论 -
jquery中的cookie
$(function () { $.cookie("team","IOI",{expires:1}); //添加 $.cookie("team","",{expires:-1}); //删除 })原创 2017-09-03 15:05:48 · 270 阅读 · 0 评论 -
cookie,localStorage,sessionStorage
!本地存储 cookie不适合大量数据的存储,因为它们由每个对服务器的请求来传递,这使得 cookie 速度很慢而且效率也不高。 localStorage - 没有时间限制的数据存储 sessionStorage - 针对一个 session 的数据存储 document.cookie="xx=xxxx";第二次无参数,即时性 localStorage.xx="";生原创 2017-10-03 17:51:15 · 340 阅读 · 0 评论
分享