Custom interaction code for image zoom

Because neither the image magnifier or the app “image zoom” is doing exactly what I want, I decided to try coding. I clicked an image>properties>onClick>+

In the SERVICES Page Code, after much research, I now have:
// For full API documentation, including code examples, visit Velo API Reference - Wix.com

export function HudsonNewsLogo_click(event) {
//Add your code for this event here:
$w(‘#HudsonNewsLogo’).show(“zoom”), zoomOptions);
}

}

Please tell me if this coding makes sense. I’m getting an error message. Note: HudsonNewsLogo is the name of the image. I wasn’t sure if I should type zoomOptions or if this is a generic term. Thank you.

Hi Ellen ,

In this code, you are trying to run .show() function on a shown image. So, this statement wont work until you hide the image on load.

$w('#HudsonNewsLogo').show("zoom"), zoomOptions); 

Regarding the zoomOptions, its a variable that you should declare, to specify the delay and duration of the zoom effect. For more information- Check THIS

Hope this helps!
Best,

Mustafa

Thanks. All I want to do is smoothly zoom in and out on an image ideally by scrolling. Neither the option on the image “it can be magnified,” nor the 3rd party app seem to work very well for zooming in. I was hoping to be able to use Wix code to solve this problem.

Hello, I’m having the same request. Has anyone achieve this? I need to smoothly zoom in and out on an enlarged image