Webflow sync, pageviews & more.
NEW
Answers

How can I make the blue gradient in the background of my Webflow site follow the cursor all the time, even when hovering over cards or images on the page?

To make the blue gradient in the background of your Webflow site follow the cursor all the time, you can use custom code and the jQuery library.

Here's a step-by-step guide:

1. Create a new interaction class: Open your Webflow project and go to the "Interactions" panel. Click on the "+" icon to create a new interaction class. Name it something like "Cursor Gradient".

2. Set up the initial state: With the "Cursor Gradient" class selected, click on the "None" dropdown and choose "New Interaction". In the interaction settings, set the initial state of the element to the gradient style you want. This could be a radial gradient, linear gradient, or any other custom gradient you prefer.

3. Add a mouse move interaction trigger: Still in the interaction settings, click on the "+" icon next to "Triggered By" and select "Mouse Move" from the dropdown.

4. Set the action for the mouse move trigger: Click on the "+" icon next to "Affect" and select "All elements with this class". This will ensure that the gradient is applied to all elements with the "Cursor Gradient" class.

5. Add custom jQuery code for updating the gradient position: Open the "Custom Code" tab in the Webflow Designer and paste the following code:

```javascript

```

Make sure to replace `.cursor-gradient` with the correct class selector for your gradient element.

6. Apply the "Cursor Gradient" class: Go to the "Classes" panel in the Webflow Designer and apply the "Cursor Gradient" class to the element you want the gradient to follow the cursor.

7. Test and refine: Preview your site and move your cursor around. The gradient background should follow your cursor. You can further customize the gradient style and adjust the jQuery code to achieve the desired effect.

Note: This method assumes you have a basic understanding of HTML, CSS, and JavaScript/jQuery. It's also worth mentioning that using custom code may impact the performance or compatibility of your site, so always test thoroughly and make sure to use supported code.

Remember to save your changes and publish your site for the changes to take effect.

Rate this answer

Other Webflow Questions