随笔分类 - js 功能特效
摘要:<!-- 返回顶部按钮 --> <a href="javascript:;" class="backtotop" id="backtotop"> 返回<br>顶部 </a> (function(){ var backtotop = document.getElementById('backtotop
阅读全文
摘要:<section class="banner" id="banner"> <ul id="carousel_list" class="carousel_list"> <li> <img src="images/banner1.jpg" alt=""> </li> <li> <img src="ima
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:https://gitee.com/eric167/js <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <met
阅读全文
摘要:(function () { // 插件核心:OOP的模式,可以创建单独的实例,这样实现私有属性和公有方法的有效管理 class zTree { constructor(element, options) { // init params let self = this, len = argumen
阅读全文
摘要:(function($){ if(!$ || !$.prototype.jquery) throw new ReferenceError('must import jquery'); // 向其原型获取方法 $.fn.extend({ zTree(data,callback){ typeof cal
阅读全文
摘要:(function(){ function LazyImage(options){ // init params options = options || {}; let defaults = { context:document, attr:'lazy-image', threshold:1, s
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta name="viewport" content="width=device
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta name="viewport" content="width=device
阅读全文
摘要:<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>单张图片懒加载案例</title> <
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi
阅读全文
摘要:// js 睡眠函数 sleep(3) number 间隔秒数 function sleep(number){ var now = new Date(); var exitTime = now.getTime() + number * 1000; while (true) { now = new D
阅读全文
摘要:// 动态添加js function appendJQCDN(src) { var head = document.head || document.getElementsByTagName('head')[0]; if(src.indexOf("js")== -1){ //css var styl
阅读全文
摘要:// 添加css document.getElementsByTagName('head')[0].innerHTML += '<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css"
阅读全文
摘要:// 数字 转换 千分位 function format(v){ // return (+v).toLocaleString(); const reg = /\d{1,3}(?=(\d{3})+$)/g; return `${v}`.replace(reg,'$&,'); }
阅读全文
摘要:export function formatDate(date, fmt) { if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文

浙公网安备 33010602011771号