Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Element change its size according to dynamicaly loaded image

$
0
0

Hi,

 

I have an element "rectangle" with size 50x50px, that is loading images dynamically.

 

The size images of the images that is loading varies , eg, 128x260, or 72x155 etc.

 

 

I want the $("rectangle") to have the same size as the dynamic image. How can i do that?

 

the image is loaded as:

          sym.$("rectangle").css({ "background-size": "auto", "background-repeat": "no-repeat", "background-image": "url(" + item.image + ")" });

 

 

but it is wrong as the image size isn't the original, It is scaled inside to $("rectangle") and it's size is 50x50.

 

I want to keep the original size of the image and the $("rectangle") change its dimensions to be the same as the image.


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>