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 设置
- 选择 自定义代码 标签
- Insert the code into the 页脚代码 section (e.g., “Before </body> tag”)
- 点击 保存更改
笔记: You can insert the code into your project using hotkeys 命令 + V (在 Mac 上)或 Control + V (在 Windows 上)。
To insert the code into an individual page:
- 启动 设计师
- 访问 页面面板 and select the page settings cog icon of the desired page
- 滚动到 自定义代码 section within the page settings
- Insert the code into the 前 </body> 标签 部分
- 点击 节省
笔记: You can paste the code into your project using hotkeys 命令 + V (在 Mac 上)或 Control + V (在 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:
- 选择 图像 you wish to magnify
- 访问 样式面板 并点击 选择器字段
- Give it a 班级 (e.g., “Magnify”)
Let’s include the “Magnify” class in our code:
- 访问 页面面板 and select the page settings cog icon of the page where your custom magnifier code is placed
- 滚动到 前 </body> 标签 section in your page’s settings
- Replace “.图像” with your class name (e.g., “.magnify”)
- 点击 节省