2025年6月12日

网站字体包加载很慢-解决方法

摘要: 网站字体包加载时间过长可能会影响用户体验,导致页面加载缓慢。为了优化字体加载时间,可以考虑以下几种方法: 使用字体加载策略 在你的@font-face规则中添加font-display: swap;可以让浏览器在自定义字体加载时先使用备用字体显示文本,等字体加载完成后再替换。 阅读全文

posted @ 2025-06-12 16:33 妍若菲 阅读(28) 评论(0) 推荐(0)

2025年5月6日

mask-image 鼠标跟随颜色变化

摘要: .ins_productCon3 { width: 100%; height: auto; position: relative; z-index: 1; overflow: hidden; --left: 0; .img_box { width: 100%; height: 5rem; backg 阅读全文

posted @ 2025-05-06 10:54 妍若菲 阅读(1) 评论(0) 推荐(0)

2024年7月15日

文字过渡动画(叠加颜色)

摘要: 1.js function aniText() { var PC = $(window).width() > 1200, mobile = $(window).width() <= 1200, winWidth = $(window).width(), winHeight = $(window).h 阅读全文

posted @ 2024-07-15 18:05 妍若菲 阅读(20) 评论(0) 推荐(0)

2024年4月17日

轮播一屏多个数量-匀速向左移动

摘要: 引入swiper 1.html <div class="inw-swipper"> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"> <div class="company-b 阅读全文

posted @ 2024-04-17 18:33 妍若菲 阅读(25) 评论(0) 推荐(0)

2022年11月18日

Js保留到小数点后有数位、decimal有效数位

摘要: 链接:https://blog.csdn.net/a772116804/article/details/125916129 假设1w 我们需要除以1亿 10010/100000000 ≈ 0.0001 const decimalFn = (num) => { if (Number.isInteger 阅读全文

posted @ 2022-11-18 11:35 妍若菲 阅读(287) 评论(0) 推荐(0)

2022年7月29日

vue判断路由变化

摘要: watch: { $route: "routerChange" } methods: { routerChange(to, from) { if (to.name == "trade") { this.showfooter = false; } } }, 阅读全文

posted @ 2022-07-29 12:16 妍若菲 阅读(225) 评论(0) 推荐(0)

2022年5月6日

Vue—babel.config.js配置文件详解

摘要: 一、概述Babel是一个JS编译器,主要作用是将ECMAScript 2015+ 版本的代码,转换为向后兼容的JS语法,以便能够运行在当前和旧版本的浏览器或其它环境中。 Vue项目中普遍使用ES6语法,若要求兼容低版本浏览器,就需要引入Babel,将ES6转换为ES5。 二、详解Vue3.0项目根目 阅读全文

posted @ 2022-05-06 11:18 妍若菲 阅读(1795) 评论(0) 推荐(0)

2022年2月26日

js保留两位小数,不四舍五入

摘要: function formatDecimal(num, decimal) { num = num.toString() let index = num.indexOf('.') if (index !== -1) { num = num.substring(0, decimal + index + 阅读全文

posted @ 2022-02-26 09:54 妍若菲 阅读(650) 评论(0) 推荐(0)

2022年2月25日

小数点后两位正则

摘要: <input type="tel" onkeyup="Num(this) placeholder="保留两位小数"> function Num(obj){ obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输 阅读全文

posted @ 2022-02-25 18:09 妍若菲 阅读(107) 评论(0) 推荐(0)

2019年8月5日

时间戳转化

摘要: function timestampToTime(timestamp) { var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '-'; var M = 阅读全文

posted @ 2019-08-05 15:56 妍若菲 阅读(78) 评论(0) 推荐(0)

导航

点击右上角即可分享
微信分享提示