04 2017 档案
性能优化2
摘要:1. 尽可能的减少 HTTP 的请求数 [content]2. 使用 CDN(Content Delivery Network) [server]3. 添加 Expires 头(或者 Cache-control ) [server]4. Gzip 组件 [server]5. 将 CSS 样式放在页面
阅读全文
去掉覆盖chrome默认填充的那坨黄
摘要:input:-webkit-autofill { -webkit-text-fill-color: $gray-96; @include box-shadow(0 0 0px 1000px $main-border-color inset); }
阅读全文
获取浏览器的各种属性
摘要:网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可见区域宽: document.body.offsetWidth (包括边线的宽);网页可见区域高: document.body.offsetHeight
阅读全文
去除空格
摘要:str为要去除空格的字符串:去除所有空格: str = str.replace(/\s+/g,""); 去除两头空格: str = str.replace(/^\s+|\s+$/g,"");去除左空格:str=str.replace( /^\s*/, '');去除右空格:str=str.replac
阅读全文
禁止鼠标右键点击事件
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script language=JavaScript> document.oncontextmenu = new Function("event.returnVa
阅读全文
把视频当成背景
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> *{margin: 0;padding: 0;} h1{margin: 50px auto;width: 300px
阅读全文
数组
摘要:增:前增(upshift) 作用:在数组前面添加内容 ;返回值:新增后的数组长度,会影响原数组的内容;后增(push) 作用:在数组后面添加内容;返回值:新增后的数组长度,会影响原数组的内容;例子:var arr=[1,2,3,4,5,6];alert(arr.upshift(true,false,
阅读全文
原生获取 键盘 keycode 鼠标 键码
摘要:<!DOCTYPE html><html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>原生js数据库测试</title> <link rel="styleshe
阅读全文
javascript 拖拽
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>拖拽</title> <style> *{ margin: 0; padding: 0; } #div1{ width: 100px; height: 100px;
阅读全文
简单的鼠标拖拽
摘要:<!doctype html><html><head> <meta charset="utf-8" /> <title></title> <style type="text/css"> *{margin:0;padding:0;} #box { width: 100px; height: 100px
阅读全文
去除select默认样式
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=n
阅读全文
select文字右对齐
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>企业信息</title> <style> select { direction: rtl;}select option { direction: ltr;} </s
阅读全文
移动端REM适配
摘要:var html = document.getElementsByTagName("html")[0]; function getFontSize(){ var width=document.documentElement.clientWidth ||document.body.clientWidt
阅读全文
cdn库
摘要:百度http://cdn.code.baidu.com/angularhttp://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.jsbootstrap3.3.4http://apps.bdimg.com/libs/bootstrap/3.3.4/
阅读全文
简单的呼吸灯效果
摘要:<!DOCTYPE HTML><html lang="zh-CN"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>test</title> <style type="text/css"> ol, ul {
阅读全文
鼠标上的canvans
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.or
阅读全文
js 碰碰球
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> * { margin: 0; padding: 0; } #box { width: 700px; height:
阅读全文
鼠标滚轮实现图片缩放
摘要:<img id="myimage" src="images/pic.jpg" alt="my image" /> <script type="text/javascript"> //添加鼠标滚轮事件处理代码 var myimage = document.getElementById("myimage
阅读全文
js全屏滚动
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{margin:0;padding:0;} ul{list-style: non
阅读全文
图片懒加载!!
摘要:<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,
阅读全文
多图上传预览
摘要:<!doctype html><html><head><meta charset="utf-8"><title>jQuery图片上传预览(不经过后端处理)</title><script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"><
阅读全文
放大镜代码
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>放大镜</title> <style> *{margin:0;padding:0;list-style: none} #div1{width:200px;heigh
阅读全文
射箭小游戏
摘要:<!DOCTYPE html><html><head> <title>Canvas射箭小游戏</title></head><style type="text/css"> body{ margin:0; background:#222; margin:20px; } svg{ width:100%;
阅读全文
关于闭包的理解
摘要:闭包就是能够读取其他函数内部变量的函数。 由于在Javascript语言中,只有函数内部的子函数才能读取局部变量,因此可以把闭包简单理解成"定义在一个函数内部的函数"。所以,在本质上,闭包就是将函数内部和函数外部连接起来的一座桥梁。闭包的用途 闭包可以用在许多地方。它的最大用处有两个,一个是前面提到
阅读全文
在IOS中 禁止长按链接与图片弹出菜单
摘要:a, img { -webkit-touch-callout: none; } 一. 使用rem作为单位html { font-size: 100px; }@media(min-width: 320px) { html { font-size: 100px; } }@media(min-width:
阅读全文
webkit表单输入框placeholder的颜色值改变
摘要:如果想要默认的颜色显示红色,代码如下:input::-webkit-input-placeholder{color:red;}如果想要用户点击变为蓝色,代码如下:input:focus::-webkit-input-placeholder{color:blue;}
阅读全文
移动端IOS手机下清除输入框内阴影
摘要:input,textarea { -webkit-appearance: none;}
阅读全文
浙公网安备 33010602011771号