随笔分类 - Html5技能
收集工作中用到的H5实用技术
摘要:1, if(window.top==window.self){ //不存在父页面 // 触摸屏幕开始播放音效 pc.events.on("Msc", function(){ if(isFistPlay){ isFistPlay = false; // 限定在首页才能播放 if(StepNum==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"> <!-- 清除
阅读全文
摘要:1, body{ overflow: hidden; background: #000000 url(res/bg1.png) no-repeat fixed center/100% 100% content-box content-box; }
阅读全文
摘要:1,html <!-- 背景音效 --> <audio autoplay="autoplay" loop="loop" preload="auto" controls="controls"src="res/audio.mp3"></audio> 2,css audio{ display: none;
阅读全文
摘要:1,html代码 <!doctype html> <html> <head> <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scal
阅读全文
摘要:1,定义layer背景样式 /* 设置layer背景透明 */ .shadows{background-color: transparent !important;box-shadow: 0 0 0 rgba(0,0,0,0) !important;} 2,layer中使用 function sen
阅读全文
摘要:1, <!-- 当浏览器不知js时的提示 --> <noscript><table style="width:100%;height:100%;"><tr style="vertical-align:middle;"><td><div style="text-align:center;">ERROR
阅读全文
摘要:1, <meta name="renderer" content="webkit" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
阅读全文
摘要:1,只能同域加载 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0,
阅读全文
摘要:1, 解决方案: 直接在CSS 文件中添加下面的代码,就可以实现了在手机端禁止粘贴复制的功能: *{ -webkit-touch-callout:none; /*系统默认菜单被禁用*/ -webkit-user-select:none; /*webkit浏览器*/ -khtml-user-selec
阅读全文
摘要:1, <!--百度统计代码及百度统计代码安装说明如下--> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:1,
阅读全文
摘要:1, <script> (function(){ const now = (new Date()).getTime(); const e = document.createElement('script'); e.setAttribute('src', `asset/js/app.js?t=${no
阅读全文
摘要:1, <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>WebAR Demo</title> <meta name="viewport" content="width=device-width, initial
阅读全文
摘要:1, switch(true){ case TXrotY < 10 : console.log("Y10"); break; case TXrotY < 20 : console.log("Y20"); break; default : break; }
阅读全文
摘要:1, <div class="leftButton" id="leftBtn" ondragstart="return!1" oncontextmenu="return!1" onselectstart="return!1"></div>
阅读全文
摘要:1, html 文件 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-sc
阅读全文