• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Background Image 'Jumps' on when viewing on phone – Sixteen Nine

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Background Image 'Jumps' on when viewing on phone – Sixteen Nine

This topic is: not resolved
  • This topic has 7 replies, 3 voices, and was last updated 10 years, 6 months ago by kilerb.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • April 8, 2015 at 7:19 am #147053
    KathleenCD
    Member

    When I view the website on my Iphone (vertical view) the background image appears to jump and shift when scrolling down. The doesn't happen on desktop, Ipad or horizontal phone view.

    Any suggestions how I might fix this?

    Thanks

    http://vanterresearch.com
    April 8, 2015 at 3:40 pm #147118
    Badlywired
    Member

    It could be related to the javascript library 'backstretch' that is used to display the background image.

    Frankly that isn't needed for your site and could be removed and replaced with standard CSS

    find the 'enqueue' with 'backstretch in them and commend them out

    body { 
      background: url(images/bg.jpg) no-repeat center center fixed; 
      -webkit-background-size: cover;
      -moz-background-size: cover;
      -o-background-size: cover;
      background-size: cover;
    }

    will work with most browsers & versions where you have the background in your theme images file as bg.jpg or whather you want


    My techy blog WordPress and stuff badlywired.com

    April 8, 2015 at 6:41 pm #147138
    KathleenCD
    Member

    Is this the section of code you mean? If so can you tell me how to correctly comment it out?

    //* Enqueue Backstretch script and prepare images for loading
    add_action( 'wp_enqueue_scripts', 'sixteen_nine_enqueue_scripts' );
    function sixteen_nine_enqueue_scripts() {

    wp_enqueue_script( 'sixteen-nine-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );

    $image = get_option( 'sixteen-nine-backstretch-image', sprintf( '%s/images/bg.jpg', get_stylesheet_directory_uri() ) );

    //* Load scripts only if custom backstretch image is being used
    if ( ! empty( $image ) ) {

    wp_enqueue_script( 'sixteen-nine-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    wp_enqueue_script( 'sixteen-nine-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'sixteen-nine-backstretch' ), '1.0.0' );

    wp_localize_script( 'sixteen-nine-backstretch-set', 'BackStretchImg', array( 'src' => str_replace( 'http:', '', $image ) ) );

    April 8, 2015 at 6:56 pm #147140
    KathleenCD
    Member

    yikes! Not sure what I've done. I'm getting the following error now. I've copied and pasted form a clean version but it didn't solve the problem. How do I fix?

    Parse error: syntax error, unexpected '*' in /home/vresearch/public_html/wp-content/themes/sixteen-nine-pro/functions.php on line 35

    Tks.

    April 8, 2015 at 7:42 pm #147147
    KathleenCD
    Member

    Whew! corrected the error. Still need a little more instruction on how to:

    'find the ‘enqueue’ with ‘backstretch in them and commend them out' - I've pasted the relevant code above

    Since I've already crashed my site once I'm obviously doing something wrong. Your help would be very much appreciated.

    April 29, 2015 at 11:42 am #149525
    KathleenCD
    Member

    Still haven't solved the problem of jumping script - I need help with the instructions provided previously to "find the ‘enqueue’ with ‘backstretch in them and commend them out"

    Here's the code... what do I do?

    //* Enqueue Backstretch script and prepare images for loading
    add_action( ‘wp_enqueue_scripts’, ‘sixteen_nine_enqueue_scripts’ );
    function sixteen_nine_enqueue_scripts() {

    wp_enqueue_script( ‘sixteen-nine-responsive-menu’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/responsive-menu.js’, array( ‘jquery’ ), ‘1.0.0’ );

    $image = get_option( ‘sixteen-nine-backstretch-image’, sprintf( ‘%s/images/bg.jpg’, get_stylesheet_directory_uri() ) );

    //* Load scripts only if custom backstretch image is being used
    if ( ! empty( $image ) ) {

    wp_enqueue_script( ‘sixteen-nine-backstretch’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/backstretch.js’, array( ‘jquery’ ), ‘1.0.0’ );
    wp_enqueue_script( ‘sixteen-nine-backstretch-set’, get_bloginfo(‘stylesheet_directory’).’/js/backstretch-set.js’ , array( ‘jquery’, ‘sixteen-nine-backstretch’ ), ‘1.0.0’ );

    wp_localize_script( ‘sixteen-nine-backstretch-set’, ‘BackStretchImg’, array( ‘src’ => str_replace( ‘http:’, ”, $image ) ) );

    May 4, 2015 at 6:01 am #150086
    KathleenCD
    Member

    Still not able to resolve this. Would really appreciate some guidance.

    Thanks
    Kathy

    August 11, 2015 at 12:36 pm #162057
    kilerb
    Member

    Ever figure this out? I'm trying to avoid this too in the 411 theme... Is it possible to have backstretch active on desktop browsers but css a different background in on mobile versions only that isn't backstretch so it doesn't jump when you scroll?

    Thanks!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble