该文被密码保护。 阅读全文
摘要:
// 封装禁止页面滚动方法(该方法兼容PC端和移动端)var topSpace = 0function BodyScroll (isState) { var bodyDoc = document.body if (isState) {topSpace = window.scrollYbodyDoc 阅读全文
摘要:
onPageScroll: function(Object) { // console.log(Object.scrollTop);//实时获取到滚动的值 } 阅读全文
摘要:
mounted() { try{ isIOS= !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) if(fn.isIOS){ window.history.pushState({}, "title", "#"); } }catc 阅读全文
摘要:
if (window.clipboardData) { window.clipboardData.setData("Text", text); } else { unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("Univ 阅读全文
摘要:
移动端: switch(plus.os.name){ case 'iOS': //获取剪切板 var UIPasteboard = plus.ios.importClass("UIPasteboard"); var generalPasteboard = UIPasteboard.generalPa 阅读全文
摘要:
使用 - scrollIntoView() 实现 具体参数自行搜索 scrollIntoView() 示例回到顶部 document.getElementById("id名称").scrollIntoView({behavior: "smooth"}); // 页面回到顶部 - 有过渡动画 阅读全文
摘要:
var u = navigator.userAgent; var ua = u.toLowerCase(); if (/iphone|ipad|ipod/.test(ua)) { // iOS 系统 -> 跳AppStore下载地址 //alert("iOS"); } else ... 阅读全文
摘要:
var broser = window.navigator.userAgent.toLowerCase(); //通过正则表达式匹配broser 中是否含有MicroMessenger字符串 if(broser .match(/MicroMessenger/i) == 'micromessenger'){ console.log('微信浏览器') } 阅读全文
摘要:
1、html 2、JavaScript // 获取高度值 (内容高+padding+边框) let height= this.$refs.getheight.offsetHeight; // 获取元素样式值 (存在单位) let height = window.getComputedStyle(this.$refs.getheight).height; //获取元素内联样式值(非内... 阅读全文