Copy link to clipboard
Copied
Hi,
the function makeResponsive have a problem, when i load two or more animations with different sizes in one page!
an.makeResponsive = function(
isResp,
respDim,
isScale,
scaleType,
domContainers
) {
var lastW,
lastH,
lastS = 1;
window.addEventListener("resize", resizeCanvas);
resizeCanvas();
function resizeCanvas() {
var w = lib.properties.width,
h = lib.properties.height;
[...]
var w = lib.properties.width,
h = lib.properties.height;
height and width will be overwritten from the last loaded animation-script!
the var "lib" must be passed here as a parameter in makeResponsitive.
an.makeResponsive = function(
*** lib, ***
isResp,
respDim,
isScale,
scaleType,
domContainers
) {
And fix:
//Code to support hidpi screens and responsive scaling.
AdobeAn.makeResponsive(lib, true,'both',false,2,[canvas,anim_container,dom_overlay_container]);
Copy link to clipboard
Copied
4 years later - thanks for that!