随笔分类 -  Html5技能

收集工作中用到的H5实用技术
摘要:1, if(window.top==window.self){ //不存在父页面 // 触摸屏幕开始播放音效 pc.events.on("Msc", function(){ if(isFistPlay){ isFistPlay = false; // 限定在首页才能播放 if(StepNum==0) 阅读全文
posted @ 2020-12-04 17:52 琥珀君 阅读(179) 评论(0) 推荐(0)
摘要:1, head头部信息 <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <!-- 清除 阅读全文
posted @ 2020-11-27 09:47 琥珀君 阅读(106) 评论(0) 推荐(0)
摘要:1, body{ overflow: hidden; background: #000000 url(res/bg1.png) no-repeat fixed center/100% 100% content-box content-box; } 阅读全文
posted @ 2020-11-18 13:52 琥珀君 阅读(208) 评论(0) 推荐(0)
摘要:1,html <!-- 背景音效 --> <audio autoplay="autoplay" loop="loop" preload="auto" controls="controls"src="res/audio.mp3"></audio> 2,css audio{ display: none; 阅读全文
posted @ 2020-11-17 17:34 琥珀君 阅读(180) 评论(0) 推荐(0)
摘要:1,html代码 <!doctype html> <html> <head> <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scal 阅读全文
posted @ 2020-10-29 16:28 琥珀君 阅读(108) 评论(0) 推荐(0)
摘要:1,定义layer背景样式 /* 设置layer背景透明 */ .shadows{background-color: transparent !important;box-shadow: 0 0 0 rgba(0,0,0,0) !important;} 2,layer中使用 function sen 阅读全文
posted @ 2020-10-28 22:51 琥珀君 阅读(2473) 评论(0) 推荐(0)
摘要:1, <!-- 当浏览器不知js时的提示 --> <noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR 阅读全文
posted @ 2020-10-14 16:32 琥珀君 阅读(110) 评论(0) 推荐(0)
摘要:1, <meta name="renderer" content="webkit" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 阅读全文
posted @ 2020-09-29 16:58 琥珀君 阅读(101) 评论(0) 推荐(0)
摘要:1,只能同域加载 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, 阅读全文
posted @ 2020-09-12 12:51 琥珀君 阅读(410) 评论(0) 推荐(0)
摘要:1, 解决方案: 直接在CSS 文件中添加下面的代码,就可以实现了在手机端禁止粘贴复制的功能: *{ -webkit-touch-callout:none; /*系统默认菜单被禁用*/ -webkit-user-select:none; /*webkit浏览器*/ -khtml-user-selec 阅读全文
posted @ 2020-09-05 17:50 琥珀君 阅读(723) 评论(0) 推荐(0)
摘要:1, <!--百度统计代码及百度统计代码安装说明如下--> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://" 阅读全文
posted @ 2020-08-23 10:25 琥珀君 阅读(183) 评论(0) 推荐(0)
摘要:1, <!-- Google Tag Manager 20180706添加--> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var 阅读全文
posted @ 2020-08-23 10:16 琥珀君 阅读(258) 评论(0) 推荐(0)
摘要:1, <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"> window.onload = funct 阅读全文
posted @ 2020-08-21 11:42 琥珀君 阅读(278) 评论(0) 推荐(0)
摘要:1, 阅读全文
posted @ 2020-08-19 17:28 琥珀君 阅读(162) 评论(0) 推荐(0)
摘要:1, <script> (function(){ const now = (new Date()).getTime(); const e = document.createElement('script'); e.setAttribute('src', `asset/js/app.js?t=${no 阅读全文
posted @ 2020-08-18 18:05 琥珀君 阅读(380) 评论(0) 推荐(0)
摘要:1, <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>WebAR Demo</title> <meta name="viewport" content="width=device-width, initial 阅读全文
posted @ 2020-08-18 15:56 琥珀君 阅读(134) 评论(0) 推荐(0)
摘要:1, switch(true){ case TXrotY < 10 : console.log("Y10"); break; case TXrotY < 20 : console.log("Y20"); break; default : break; } 阅读全文
posted @ 2020-08-15 19:31 琥珀君 阅读(179) 评论(0) 推荐(0)
摘要:1, <div class="leftButton" id="leftBtn" ondragstart="return!1" oncontextmenu="return!1" onselectstart="return!1"></div> 阅读全文
posted @ 2020-08-07 15:37 琥珀君 阅读(145) 评论(0) 推荐(0)
摘要:1, html 文件 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-sc 阅读全文
posted @ 2020-08-06 22:55 琥珀君 阅读(802) 评论(0) 推荐(0)
摘要:1, 阅读全文
posted @ 2020-08-05 15:10 琥珀君 阅读(139) 评论(0) 推荐(0)