Sie sind nicht angemeldet.

1

Dienstag, 3. August 2010, 03:07

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?

2

Mittwoch, 4. August 2010, 13:15

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.

Quellcode

1
<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.

Quellcode

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


best regards,
Klaus

3

Donnerstag, 5. August 2010, 13:49

Solution

Thank you very much! Your answer is really solution of my problem!

Ähnliche Themen