top of page
LOGO
SendZoomFree Demo

Creating Zoom Effects for Images in Repeater in Wix Using Velo

Writer: CD Studio .
CD Studio .
Nov 6, 2023
3 min read

Explore a step-by-step guide on how to implement captivating image zoom effects within a Wix website using Velo. Elevate your site's design with this easy-to-follow tutorial for a dynamic visual experience.


Zoom effect in Repeater



Prerequisite:

Before you start this tutorial, you need to create a Wix site and design a repeater


Step1:Enable CMS (Formerly Known as Content Manager)





To be able to add repeater , all the data must be in the CMS. For that, you need to enable CMS.




From the left side of the editor, select CMS Which is selected in the image.






Step 2: Create a Collection

After, adding CMS to the site, Add a collection (it's like a table in a database).



  • Select the CMS icon from the left window panel as you did in the last step, then click on Create Collection

  • Or, Click on Add Element > CMS > Create Collection






Name your collection, for example, I gave "images". Then click on Create.


Step 3: Add Fields to the Collection




Click on the "Title" Field > Edit to Edit your field name. I named it "Name" .






Adding Image field


You can Add images


Click on "Add field" (On the right side of the Title field) to Add other fields to the collection.


Now I am adding another field named 'image".

Here, the field type is kept as image.



After adding the fields, you can add the contents you want here. (You can always edit content later)







In order to connect the elements on your page with the content in your CMS, you have to add a dataset to the page (it will be invisible in the published website).


Add element > CMS > Dataset






Once you inserted the dataset click on it and select the settings.










Then Select Your Collection,

here I selected images.


After you configure the dataset, click on the repeater, and from the options click on "Connect to CMS"

Click on each element and connect it to the relevant fields.




Click on Image


Select the "Image source connects to" to the Image field





Likewise, connect other elements to the respective fields.




Now your Repeater should be populated with data from your CMS



To configure the buttons, we need to enable "Dev Mode" in order to write a few lines of simple code.


On the top left of the window hover over Dev mode.


Then click on Turn on Developer Mode


Install the Velo Package



Search for wix-animation-helpers, then click on the install button.


Now that we have successfully Installed wix-animation-helpers

Following better coding standards, it is good to rename the 'id' of the elements, in this case, our elements are, Repeater: #repeater1, image: #image



On the left side of where you renamed the id, you can see the code panel. This is where we are going to write the code.




The code is as follows, copy paste from below to test it out:





import { zoom } from '@velo/wix-animation-helpers';

$w.onReady(function () {

    $w('#repeater1').onItemReady(($item, itemData, index) => {
        const images = $item("#image")
        const zoomTimeline = zoom(images, { duration: 600, pause: true });
        images.onMouseIn(() => zoomTimeline.play());
        images.onMouseOut(() => zoomTimeline.reverse());
    });

});


On the top right side, click on "Preview" to see if your code is working. If it is working, then you can publish.

onMouseIn will enlarge the image. When onMouseOut the image will be the same as before.




ZoomOut




ZoomIn





You can visit the example website here.




3 Comments


Роман Грицюк
Sep 21

Коли хочеться мати під рукою кілька різнопланових сайтів, така добірка досить зручна. Теми про дім, сад і побут можна переглянути на цьому вебсайті, а для сучасних цифрових сервісів і техніки перейти сюди. Практичні поради для повсякденних справ часто можна знайти на сайті, а матеріали про догляд, здоров’я, красу та стосунки — за цим посиланням, тому всі чотири ресурси зручно використовувати залежно від конкретної теми.

Like

Lifehata
Sep 06

Блог Lifehata подойдет тем, кто любит знакомиться с разноплановыми материалами и узнавать что-то новое. Публикации охватывают разные сферы и рассчитаны на широкую аудиторию.

Like

Infosaray
Sep 05

Серед інформаційних ресурсів можна переглянути цей сайт, де поєднуються матеріали різних напрямів. Тут можна знайти контент для практичного використання або звичайного читання. Такий баланс робить ресурс універсальнішим.

Like
bottom of page