(This page includes affiliate links. If you click and purchase, I receive a small commission at no extra cost from you and that way you can support me. I only recommend tools that I have personally used and loved.)
Get Elementor Pro Today –
1 – Elementor Pro
Preview link or Custom content when hovered on a link – Elementor & Javascript
In this tutorial, we are going to create interaction in which when hovered on a link, we simply show a container with any content. It can simply be an image with preview of the link or some stats or anything that we wish for. In the paid template, I have added image and a button which seems like the most common use but you can customize it however you want. Also, 2 versions are given, first version shows box centered to link and second version shows box left aligned to the link. The link and corresponding preview box is based on the order of the links and preview containers. Consider watching above video to understand it better.
Hello, My Name is Mayuresh Koli, a wordpress website creator. You can find my portfolio at DMmotionarts.com and all my websites are made using WordPress and Elementor.
Version 1 – Centered Reveal Box to link
- dm-preview-container is the CSS class of parent container of preview box.
- dm-preview-link-box is the CSS class of the container inside dm-preview-container and should content all the contents that are visible when hovered.
- dm-preview-link is the CSS class of the link that should show preview box.
- dm-grad-text is an extra CSS class that you can use for your links to give gradient color. (Optional)
- We have hidden the preview container by making display:none for devices under 1024px width. If you wish to use it, simply remove the code. For Tablet/Mobile, the code might not work well due to nature to touch devices.
- Important: There should always be equal amount of dm-preview-link, dm-preview-container & dm-preview-link-box CSS classes. Else the whole code will not work. Also, the order of preview container decides on which link the preview container should show. Example: first link will show first preview container, second link will show second preview container and so on.
Version 2 – Left Aligned Reveal Box to link
- dm-preview-container is the CSS class of parent container of preview box.
- dm-preview-link-box is the CSS class of the container inside dm-preview-container and should content all the contents that are visible when hovered.
- dm-preview-link is the CSS class of the link that should show preview box.
- dm-grad-text is an extra CSS class that you can use for your links to give gradient color. (Optional)
- We have hidden the preview container by making display:none for devices under 1024px width. If you wish to use it, simply remove the code. For Tablet/Mobile, the code might not work well due to nature to touch devices.
- Important: There should always be equal amount of dm-preview-link, dm-preview-container & dm-preview-link-box CSS classes. Else the whole code will not work. Also, the order of preview container decides on which link the preview container should show. Example: first link will show first preview container, second link will show second preview container and so on.