Hover Image
An image that appears while the pointer is over an element and follows the cursor, with a little inertia and tilt. Items that sit side by side share one card, so moving from one to the next cross-fades the picture instead of opening a new one. Hover Image is a Pro widget.
Requires: no animation library. It is plain JavaScript and CSS.
Where to find it#
As an element: Elements panel › Bricksify › Hover Image. It is a box like Bricks' Block, with all the layout controls, any tag including a link, and any content inside; it is inserted with a heading in it. Its settings are in the Hover Image (Bricksify) group.
As a control group: Hover Image (Bricksify) on Block, Div, Container, Heading, Basic Text, Text Link and Button. See How widgets work.
Nothing happens until you choose an Image; the other settings appear once you have.
Settings#
| Setting | Options | Default | What it does |
|---|---|---|---|
| Image | A media library image or dynamic data, for example the featured image | The picture shown on hover. | |
| Motion | Reveal, Pop | Reveal | Reveal opens the card from the centre while the image sharpens from a blur. Pop grows the card from nothing and fades it in on a quick spring, follows the cursor on the same spring and swaps images at once. |
| Card position | Centred on the cursor, Below right of the cursor | Centred on the cursor | Where the card sits relative to the pointer. |
| Distance from the cursor (px) | 20 | With Below right: the gap between the pointer and the card’s top left corner. | |
| Layer | Above everything, Behind this element, over its neighbours | Above everything | Above everything floats the card over the page. Behind keeps the hovered item's own content in front of the card while the card covers the other items. |
| Card width | Any CSS width | clamp(120px, 8.21vw, 320px) | How wide the card is. |
| Aspect ratio | 300 / 370 | The card's shape. The image is cropped to fill it. | |
| Corner radius | 8px | ||
| Card background | Any CSS colour | transparent | Seen for an instant while one image cross-fades into the next. |
| Card border | Any CSS border | none | For example 1px solid #e5e5e5. |
| Follow inertia (s) | 1 | How long the card takes to catch up with the cursor. 0 makes it stick to the cursor. Reveal only. | |
| No tilt | On / off | Off | Stops the card tilting as the cursor moves sideways. Reveal only (Pop never tilts). |
| Zoom in on change | On / off | Off | The new image settles from 1.2× while it sharpens. Reveal only. |
| Show inline on touch and under 992px | On / off | Off | Where there is no cursor to follow, shows the image inside the element instead. |
How it behaves#
Groups: every item with an image under the same parent shares one card. In a list of rows that is what you want: the card stays open and the pictures cross-fade as you move down the list. A single item on its own is simply a group of one. The card takes its size, shape, layer, inertia, tilt and zoom from the first item in the group, so set those on the first one, or the same on all of them.
When the pointer enters an item, the card opens around the cursor and the image sharpens in from a blur. The card centres on the cursor and follows it; moving sideways tilts it, and it straightens again a moment after the cursor stops. When the pointer leaves, the card closes. With Motion: Pop the card instead grows out of the cursor point and fades in on a spring (framer-motion’s mass 0.1, stiffness 100, damping 10), follows the pointer on that same spring, changes picture instantly, and shrinks away when the pointer leaves.
Where it runs: only with a mouse or trackpad, on screens 992px and wider. On touch screens and below 992px there is no card: the image is not shown at all, unless Show inline on touch and under 992px is on, in which case it appears inside the element, up to 320px wide, in the same aspect ratio and corner radius.
The image is decorative: it has empty alt text and the card is hidden from screen readers. Nothing runs inside the Bricks builder.
Reduced motion and without JavaScript#
For a visitor who has asked for reduced motion, the card is switched off and the element shows as it is. Without JavaScript, or without the plugin, the element is unchanged and no image shows on hover.
Motion: Stack#
Stack does not follow the cursor. One frame (Card width, default 25vw, by Frame height, default 70%) sits in the middle of the stage, behind its content: the closest section, the parent of the items, or the closest element matching a selector. Hovering (or focusing) an item opens its image from the centre (clip from 50% to 0, 0.8s, ease in-out) over the images opened before, so moving down a list wipes one picture open over the last; the frame drifts a little towards the cursor. Leaving the items closes every image back into its centre. Settings are read from the first item of the group.
| Setting | Default | What it does |
|---|---|---|
| Stack: frame centred in / Stage selector | the section around the items | Where the frame sits |
| Card width / Frame height | 25vw / 70% | Frame size (height: share of the stage height, or a length) |
| Corner radius | 0 | Frame corners |
| Reveal duration (s) / Reveal ease | 0.8 / ease in-out | Opening and closing; each image also fades in over 0.22s |
| Drift towards the cursor | 0.08 | Share of the cursor distance from the stage centre; 0 = off |
| Drift limits / still zone / smoothing | 16px, 12px / 24px / 0.7s | How far, from where, how soft |
| Images kept in the pile | 20 | The oldest fades out past this |
Show inline below (with Show inline on, any motion) chooses where the image appears inside the element instead: under 992px and on touch (default), under 768px, or under 479px. Style it with the class bx-himg__img. Stack runs only with a mouse, from 992px, without reduced motion.
Used in#
Roll List (card above, with zoom) and Roll Behind (card behind, with the inline image on touch), on the rows of each list. Services Hover Table (Pop, below right of the cursor, with a border).
Projects Case Index, on its rows (Stack, stage .cevx-stage, inline under 479px).