随笔分类 - js
简单的小特效
vue,react,angular
摘要:一、Vue.js: 其实Vue.js不是一个框架,因为它只聚焦视图层,是一个构建数据驱动的Web界面的库。 Vue.js通过简单的API(应用程序编程接口)提供高效的数据绑定和灵活的组件系统。 Vue.js的特性如下: 1.轻量级的框架 2.双向数据绑定 3.指令 4.插件化 优点: 1. 简单:官
阅读全文
npm安装cnpm、vue、react
摘要:安装cnpmnpm install -g cnpm --registry=https://registry.npm.taobao.org 安装vuecnpm install --global vue-clivue init webpack my-projectcd my-projectcnpm in
阅读全文
登录之后返回上一页
摘要:var referrer=window.document.referrer;var referrarArray=referrer.split("//"); if(window.location.protocol.toLowerCase() != referrarArray[0]){ referrer
阅读全文
小程序防止重复点击打开多个页面
摘要:/** * 导航工具一 */ static navTo(obj) { var app = getApp(); if (app.globalData.isClicked) { return; } app.globalData.isClicked = true; wx.navigateTo({ url:
阅读全文
e.stopPropagation()兼容性处理
摘要:使用jquery库,e.stopPropagation()兼容所有。 原生的就要这么写 function stopPropagation(e){ e=window.event||e; if(document.all){ //只有ie识别——————可能有误(document.all主要用来判断是否为
阅读全文
ie9 不执行js,打开控制台就好了
摘要:IE仅在开启developer tools的时候,脚本才能访问到console这个对象 (console在代码调试时很有帮助,但是在生产环境中,应该移除掉,或至少应该先判断这个对象是否存在,毕竟无插件支持的IE6下也是没有这个对象的) 即为IE9不开启调试者工具console不存在导致的。 cons
阅读全文
上传头像将光标去掉
摘要:onfocus="this.blur();" unselectable="on" onfocus="this.blur();"支持火狐,谷歌等主流浏览器 unselectable支持ie浏览器
阅读全文
网页不能复制
摘要:网页不能复制<body leftmargin="10" topmargin="0" marginheight="0" marginwidth="0" onmousemove='HideMenu()' oncontextmenu="return false" ondragstart="return f
阅读全文
省市联动效果
摘要:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www
阅读全文
滚动到底部加载
摘要:$(window).scroll(function(){ if($(document).scrollTop()>=$(document).height()-$(window).height()){ alert("可以加载了"); } });
阅读全文
金钱格式化(本地化)
摘要:var box = 1111111111;alert(box.toLocaleString());
阅读全文
返回头部js
摘要:$('.backTop, .backCss').click(function() { var id=$(this).attr('class'); $('html, body').animate({scrollTop: $('#'+id).offset().top}, 500); }); $("bod
阅读全文
jquery库google加载
摘要:加载js库的时候可以加载google CDN,可以同时加载多个jquery库<script src="http://www.google.com/jsapi"></script>google.load("jquery","1.4.2");google.setOnLoadCallback(functi
阅读全文
input.text文件提示效果
摘要:<div class="search"><input type="text" value="Seach Products" onFocus="if(this.value=='Seach Products'){this.value='';this.style.color='#222';}" onBlu
阅读全文
漂浮广告
摘要:<div id="img" style="position:absolute;; width: 561; height: 473"><a href="http://www.aqsw.cn/index.asp" target="_blank"><img src="images/fudong.jpg"
阅读全文
浙公网安备 33010602011771号