随笔分类 - 实用
新闻滚动条
摘要:<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,
阅读全文
百度联想
摘要:<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>百度首页联想词</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maxim
阅读全文
模仿百度联想
摘要:<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <title></title> <style> * { margin: 0; padding: 0; list-style: none; } .box { width: 640
阅读全文
滑块验证码
摘要:<!DOCTYPE html> <head> <meta charset="utf-8" /> <title></title> <style> #box { position: absolute; width: 50px; height: 50px; background-color: #FF6E3
阅读全文
meta
摘要:<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> <meta name="apple-
阅读全文
生成有序的随机数
摘要:<script> function randomNumber(n, start, end) { var i = 0, arr = []; for (; arr.length < n; i++) { var num = Math.floor(Math.random() * (end - start))
阅读全文
图片验证码及自动刷新
摘要:<script> function imgCode() { $("#imgCode").on("click", function() { $(this).attr("src", '/user/verify?t=' + Math.random()); }); }; /* 当后台返回验证码错误时,绑定t
阅读全文
地址跳转
摘要:var _HOSTNAME_ = [window.location.protocol, '//', window.location.hostname, '/'].join(''); if (/^http/.test(data.data.url)) { window.location.href = d
阅读全文
验证码倒计时
摘要:<body> <span id="sendCode" style="background: #ccc;padding: 5px;">发送验证码</span> <script src="http://code.jquery.com/jquery-1.12.0.min.js"></script> <sc
阅读全文
判断浏览器内核
摘要:<script> var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return { //移动终端浏览器版本信息 trident: u.indexOf('Tr
阅读全文
将url转化成对象
摘要:<script> var url = "baidu.com?"; //var url = window.location.search; //获取url function getUrl(url) { var obj = {}, arr = [], temp = []; arr = url.split
阅读全文
仿支付宝金额输入规则
摘要:<!-- 正则 --> <body> <input type="text" id="pay"> <script> document.getElementById("pay").addEventListener("input", function() { this.value = this.value
阅读全文
浙公网安备 33010602011771号