随笔分类 -  JS浏览器窗口

摘要:一般用于本地存储中使用(中英文切换本地存储,刷新页面): location.reload(); 阅读全文
posted @ 2020-03-16 15:09 YJUI 阅读(194) 评论(0) 推荐(0) 编辑
摘要:BOM:浏览器对象模型 新窗口打开window.open(url)当前页打开:location.href = url 阅读全文
posted @ 2020-02-18 10:39 YJUI 阅读(259) 评论(0) 推荐(0) 编辑
摘要://分辨率兼容 ;(function(win,doc){ var rem = 40/750*doc.documentElement.clientWidth; doc.documentElement.style.fontSize=rem+'px'; win.addEventListener('resi 阅读全文
posted @ 2019-02-18 11:49 YJUI 阅读(154) 评论(0) 推荐(0) 编辑
摘要:var source_platform = '' , pf_source = 2; //系统平台 //区别是否是 微信浏览器 , source_platform 系统平台 2018.12.6新增 var ua = navigator.userAgent, source_platform = ''; 阅读全文
posted @ 2019-01-29 14:44 YJUI 阅读(311) 评论(0) 推荐(0) 编辑
摘要:通过userAgent是否包含MicroMessenger来判断是否在微信内置浏览器打开网页 //区别是否是 微信浏览器 , source_platform 系统平台 var ua = navigator.userAgent , source_platform = ''; if (ua.match( 阅读全文
posted @ 2019-01-22 10:40 YJUI 阅读(169) 评论(0) 推荐(0) 编辑
摘要:网页可见区域宽:document.body.clientWidth 网页可见区域高:document.body.clientHeight 网页可见区域宽:document.body.offsetWidth (包括边线的宽) 网页可见区域高:document.body.offsetHeight (包括 阅读全文
posted @ 2019-01-07 15:18 YJUI 阅读(420) 评论(0) 推荐(0) 编辑

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