Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Animatron动画以响应的方式工作_Javascript_Html_Animation_Responsive Design_Animatron - Fatal编程技术网

Javascript Animatron动画以响应的方式工作

Javascript Animatron动画以响应的方式工作,javascript,html,animation,responsive-design,animatron,Javascript,Html,Animation,Responsive Design,Animatron,我刚用Animatron制作完html5动画,并下载了我的材料(项目html)…因为我的动画会转到响应性网站,我必须更改代码,使其以响应性方式工作 问题是我以前并没有使用过Js代码,以及如何更改它 这是Animatron给我的代码,宽度和高度在哪里。 我如何改变这种工作方式 : var宽度=1472; var高度=485; 变量playerParams={ 宽度:宽度, 高度:高度,, 自动播放:错误, 重复:错, controlsEnabled:正确 }; var包装器_ID='target

我刚用Animatron制作完html5动画,并下载了我的材料(项目html)…因为我的动画会转到响应性网站,我必须更改代码,使其以响应性方式工作

问题是我以前并没有使用过Js代码,以及如何更改它

这是Animatron给我的代码,宽度和高度在哪里。 我如何改变这种工作方式 :


var宽度=1472;
var高度=485;
变量playerParams={
宽度:宽度,
高度:高度,,
自动播放:错误,
重复:错,
controlsEnabled:正确
};
var包装器_ID='target';
var wrapper=document.getElementById(包装器ID);
document.body.className='no-iframe';
wrapper.className='no-iframe';
wrapper.style.width=宽度+px;
wrapper.style.height=高度+px;
wrapper.style.marginLeft=-Math.floor(宽度/2)+'px';
wrapper.style.marginTop=-Math.floor(高度/2)+'px';
.
.
.

//Mika

此代码来自Codepen:

HTML:

代码笔链接:


从这里找到:

你好,米卡!请联系我们feedback@animatron.com所以我们可以帮你,我会帮你的!谢谢!
<script type="text/javascript">
    var width = 1472;
    var height = 485;

    var playerParams = {
        width: width,
        height: height,
        autoPlay: false,
        repeat: false,
        controlsEnabled: true
    };

    var WRAPPER_ID = 'target';
    var wrapper = document.getElementById(WRAPPER_ID);

    document.body.className = 'no-iframe';
    wrapper.className = 'no-iframe';
    wrapper.style.width = width + 'px';
    wrapper.style.height = height + 'px';
    wrapper.style.marginLeft = -Math.floor(width / 2) + 'px';
    wrapper.style.marginTop = -Math.floor(height / 2) + 'px';
    .
    .
    .
<div id="target" style="position: absolute; top: 0; left: 0;"></div>
var player = anm.Player.forSnapshot(
        'target', /* target tag ID */
        'http://clips.animatron-test.com/77ffa1bd4f69cba221ecd17326bc9d6a.json?a=1', /* snapshot URL */
        anm.importers.create('animatron') /* importer which can parse
           the given scene, in our case it is included in the bundle and
           named 'animatron'; its instance may be re-used */
        );

       var windowResize = function(){
           player._resize(window.innerWidth, window.innerHeight);
       }

       windowResize();
       window.onresize = windowResize;