Blurring Row Background Images

Someone asked if it was possible to blur a background-image using filters for Beaver Builder rows. Due to the way the background-container is used and all elements are positioned into it, when adding the filter:blur() properties as a class, all contents will be blurred out. So I decided to go another route.

Using jQuery a selection of the properties are copied over to a newly inserted element at the bottom of the parent-container, so behind the background. It matches all appropriate styles automatically and adds a few that are needed to fit the blurred image behind the container. It then removes the image from the initial container.

There are a few things:

  1. The blurred version of the image will probably be slightly bigger than the original because the borders are blurred out too. We enlarge the image by 10% and hide 5% on all sides out of view.
  2. It might have a slight delay, it executes on document-ready.
  3. Because the borders need to be hidden the containing container needs to hide the overflow. When editing the page this is a problem, because the icons to edit modules and rows are also outside of the container. So the blur effect is only applied when we are NOT in the editor.
  4. When saving or cancelling an edit, the page is not reloaded and does not display the blur immediately. Just hit reload and the blur effect is applied. Visitors should see the blur applied normally.

You only need to do three things to apply the blur:

  1. Copy the code that is below to your “Global Settings > Javascript” tab.
  2. Add a row-background-type ‘Image’ and an image (can be a connector if you want to).
  3. Add a class-name called ‘blureffect’ to that row on the ‘Advanced’ tab.

Save, reload and watch it happen. Any row that has the class ‘blureffect’ applied to have that blur, no matter what the image is.

[pastacode lang=”javascript” path_id=”9ba7b8ab8e18c0d2fbbcac51cc30971a/96a8313dbf4b22ce4486cdb07b5bbbcb856e4438″ file=”” highlight=”” lines=”” provider=”gist”/]

Posted in

Beaverplugins

Web ninja with PHP/CSS/JS and Wordpress skills. Also stand-in server administrator, father of four kids and husband to a beautiful wife. Always spends too much time figuring out ways to do simple things even quicker. So that you can benefit.

2 Comments

  1. Richard Cooke on May 22, 2018 at 4:43 pm

    That’s great! How about an effect like this one: https://jordanhollinger.com/media/bmu-landing.png



  2. Andrew on February 4, 2019 at 10:14 pm

    Do you have a recommendation on changing this to work with the parallax background setting?