Fit images within a repeater

Hi All

came across this code:

$w ( “#Image” ). fitMode = “fixedWidth” ;

but it says that fitMode does not exist on type container. As I am using a repeater linked to a dataset, and dont see a way to tell the above formula to highlight just the image portion of the repeater, is there a alternative method to getting all my images in a repeater to fit as I would prefer instead of cropping?

instead of $w, it has to be $item…

wrong!
$w ( “#Image” ). fitMode = “fixedWidth” ;
right!
$item ( “#Image” ). fitMode = “fixedWidth” ;

Try this one…

$w.onReady(()=>{
	$w('#repeater1').onItemReady(()=>{
		$item("#Image").fitMode= "fixedWidth";
	});
});

seems to have a issue with the item portion as it highlights it in red?

Sorry, but anybody can see the error ecxept you., if you don’t show a screenshot.

OK, i see! Of course MY FAULT!

I forgot something in my code…

$w.onReady(()=>{
	$w('#repeater1').onItemReady(($item, itemData, index)=>{
		$item("#Image").fitMode="fixedWidth";
	});
});

…it works for you now?