I"m trying to set the flex css property of image containers to the aspect ratio of the image. I want the flex css to be in form flex: 1.798245
with no px or 1 1 1px.
Using jQuery css() method it keeps setting it to flex: 1 1 1.798245px
//gallery flex
$('.gallery-item').each(function(){
var value = $("img", this).width() / $("img", this).height();
$(this).css("flex", value);
});
How should I pass value to css() to get the result I want?