html banner.html
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html banner.html相关的知识,希望对你有一定的参考价值。
<!-- Sizmek, 2018-10-12 -->
<!DOCTYPE html>
<html>
<head>
<title>index</title>
<meta charset="UTF-8">
<meta name="ad.size" content="width=1920,height=240">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1" />
<script type="text/javascript" src="https://secure-ds.serving-sys.com/BurstingScript/EBLoader.js"></script>
<script type="text/javascript" src="https://secure-ds.serving-sys.com/BurstingcachedScripts/libraries/createjs/createjs-2015.11.26.min.js"></script>
<style type="text/css">
body {
margin: 0px;
overflow: hidden;
}
#canvas {
cursor: pointer;
width: 1920px;
height: 240px;
}
</style>
<script src="https://banners.adfox.ru/181119/adfox/597444/2755008/index.js"></script>
<script>
function isLocal() {
return /(sizmek\.ru|file\:\/\/\/|localhost|192\.168\.|127\.0\.0\.1)/.test(window.location.href);
}
function clickthrough1() {
EB.clickthrough();
if (isLocal()) {
console.log('> click');
}
}
function initEB() {
startAd();
}
function startAd() {
if (typeof init === 'function') {
init();
}
}
if (isLocal()) {
console.log(' -- Sizmek, 2018-10-12 -- ');
}
var canvas, stage, exportRoot, anim_container, dom_overlay_container, fnStartAnimation;
function init() {
canvas = document.getElementById("canvas");
anim_container = document.getElementById("animation_container");
dom_overlay_container = document.getElementById("dom_overlay_container");
var comp = AdobeAn.getComposition("F368CF77C71E4BFD93AF980B4D28A00B");
var lib = comp.getLibrary();
handleComplete({}, comp);
// CLICK //////
document.getElementById('animation_container').addEventListener('click', clickthrough1);
// CLICK //////
}
function handleComplete(evt, comp) {
var lib = comp.getLibrary();
var ss = comp.getSpriteSheet();
exportRoot = new lib.x240_rt18_Lyceum_students_02();
stage = new lib.Stage(canvas);
fnStartAnimation = function() {
stage.addChild(exportRoot);
createjs.Ticker.setFPS(lib.properties.fps);
createjs.Ticker.addEventListener("tick", stage);
}
function makeResponsive(isResp, respDim, isScale, scaleType) {
var lastW, lastH, lastS = 1;
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
function resizeCanvas() {
var w = lib.properties.width,
h = lib.properties.height;
var iw = window.innerWidth,
ih = window.innerHeight;
var pRatio = window.devicePixelRatio || 1,
xRatio = iw / w,
yRatio = ih / h,
sRatio = 1;
if (isResp) {
if ((respDim == 'width' && lastW == iw) || (respDim == 'height' && lastH == ih)) {
sRatio = lastS;
} else if (!isScale) {
if (iw < w || ih < h)
sRatio = Math.min(xRatio, yRatio);
} else if (scaleType == 1) {
sRatio = Math.min(xRatio, yRatio);
} else if (scaleType == 2) {
sRatio = Math.max(xRatio, yRatio);
}
}
canvas.width = w * pRatio * sRatio;
canvas.height = h * pRatio * sRatio;
canvas.style.width = dom_overlay_container.style.width = anim_container.style.width = w * sRatio + 'px';
canvas.style.height = anim_container.style.height = dom_overlay_container.style.height = h * sRatio + 'px';
stage.scaleX = pRatio * sRatio;
stage.scaleY = pRatio * sRatio;
lastW = iw;
lastH = ih;
lastS = sRatio;
stage.tickOnUpdate = false;
stage.update();
stage.tickOnUpdate = true;
}
}
makeResponsive(false, 'both', false, 1);
AdobeAn.compositionLoaded(lib.properties.id);
fnStartAnimation();
}
</script>
</head>
<body onload="initEB();">
<div id="animation_container" style="background-color:rgba(255, 255, 255, 1.00); width:1920px; height:240px">
<canvas id="canvas" width="1920" height="240" style="position: absolute; display: block; background-color:rgba(255, 255, 255, 1.00);"></canvas>
<div id="dom_overlay_container" style="pointer-events:none; overflow:hidden; width:1920px; height:240px; position: absolute; left: 0px; top: 0px; display: block;"></div>
</div>
</body>
</html>
以上是关于html banner.html的主要内容,如果未能解决你的问题,请参考以下文章
如何通过js跨域调用ASP.NET Web API (请问如何实现在javascript中通过http get的方式跨域调用ASP.NET Web API?)