You may have images in your website that are rich in intricate details — such as product photos or artwork. By using some custom code, you can enable your visitors to hover over and amplify specific parts of these images — all without having to move a muscle.
This tutorial will guide you through the process of enlarging your images by inserting custom code into a page or a project by following these steps:
- Insert the custom code
- Assign a class name
- Customize the magnifier
Insert the custom code
There are two methods to insert the custom code into your project:
- Include the code in the entire project
- Integrate the code in an individual page
To insert the code into your entire project:
- Access your project’s Settings
- Select the Custom code tab
- Insert the code into the Footer code section (e.g., “Before </body> tag”)
- Click Save changes
Note: You can insert the code into your project using hotkeys Command + V (on Mac) or Control + V (on Windows).
To insert the code into an individual page:
- Launch the Designer
- Access the Pages panel and select the page settings cog icon of the desired page
- Scroll to the Custom code section within the page settings
- Insert the code into the Before </body> tag section
- Click Save
Note: You can paste the code into your project using hotkeys Command + V (on Mac) or Control + V (on Windows).
You have successfully integrated the custom code into your project!
Assign a class name
Let’s assign a unique class name to the images that we want to apply the magnification effect to:
- Select the Image you wish to magnify
- Access the Style panel and click on the Selector field
- Give it a class (e.g., “Magnify”)
Let’s include the “Magnify” class in our code:
- Access the Pages panel and select the page settings cog icon of the page where your custom magnifier code is placed
- Scroll to the Before </body> tag section in your page’s settings
- Replace “.image” with your class name (e.g., “.magnify”)
- Click Save