Image Hotspot size depend on screensize

  • Hi! May you help me with such problem?

    I have image hotspot with sides ratio 4/3 and I want: 1) to keep sides ratio when screensizes change 2) picture should be all visible in the screen.

    I tried to do it using action with command if(condition, true-actions, false-actions*), but it didn't help me (may be my code is not very good).

    Idea is simple: x and y - sides of image, image_sides_ratio=x/y, X and Y - sides of screen;
    if (X/Y) < (x/y) = sides_ratio ;
    than make x smaller than X (x=X-30) and y make in according with x and image side ratio (y=x/image_sides_ratio);
    else (y=Y-30, x=image_sides_ratio*y).

    Can you tell me how you solve this problem or how to code right method mentioned above?

  • Hi,

    do you mean a <plugin> or <hotspot> element?

    the size of a hotspot or plugin will not change automatically when the screen resizes,

    for hotspots you could use - zoom="true" - or - distorted="true" - to scale the hotspots
    automatically with the screensize,
    e.g.

    Code
    <hotspot ... zoom="true" .../>

    but the plugins will only scale with the screensize when you set a relative percent size,
    in this case you could use "prop" as setting for width or height to keep the aspect of the image,
    e.g.

    Code
    <plugin ... width="20%" height="prop" />

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!