Support » Theme: Satisfy » Background image

  • Resolved sandernolan

    (@sandernolan)


    Hi Webbjocke,

    I’ve set the background image to ‘scroll with background’ – works perfectly on desktop clients but on mobile the image stays stuck. Seems to happen with all different configurations possible with the image.

    Any ideas are greatly appreciated!

    Many thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Webbjocke

    (@webbjocke)

    Hi yeah the WordPress fixed image background doesn’t work on mobiles. This is a problem for many themes since it uses a css feature called “background-attachment” for the effect, which is disabled on many mobile devices.

    To fix it for Satisfy you can add the javascript below to your site. It can be done using this plugin for example: https://wordpress.org/plugins/tc-custom-javascript/

    jQuery(function ($) {
        if ($('body').css('background-image')) {
            $('<div>').css({
                'background': $('body').css('background-image'),
                'position': 'fixed',
                'width': '100%',
                'height': '100%',
                'background-position': 'center',
                'background-size': 'cover',
                'z-index': '0'
            }).prependTo('body')
            $('#site-footer').css('position', 'relative')
        }
    })

    Ah perfect thanks so much! Works perfectly 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Background image’ is closed to new replies.