Skip to content

Instantly share code, notes, and snippets.

@MrFent
Created October 17, 2019 22:21
Show Gist options
  • Save MrFent/6a97fb04ed6fee1d115ebecfc839d29e to your computer and use it in GitHub Desktop.
Save MrFent/6a97fb04ed6fee1d115ebecfc839d29e to your computer and use it in GitHub Desktop.
//Line 2055
if ( 'parallax' == $row->settings->bg_type && ! empty( $row->settings->bg_parallax_image_src ) ) {
$attrs['data-parallax-speed'] = $row->settings->bg_parallax_speed;
$attrs['data-parallax-image'] = $row->settings->bg_parallax_image_src;
$attrs['data-parallax-offset'] = $row->settings->bg_parallax_offset;
}
//Line 373
/**
* Fires when the window is scrolled to adjust
* a single parallax background.
*
* @since 1.1.4
* @access private
* @method _scrollParallaxBackground
*/
_scrollParallaxBackground: function()
{
var win = $(window),
row = $(this),
content = row.find('> .fl-row-content-wrap'),
speed = row.data('parallax-speed'),
offset = content.offset(),
yPos = -((win.scrollTop() - offset.top) / speed),
initialoffset = ( row.data('parallax-offset') != null ) ? row.data('parallax-offset') : 0,
totaloffset = yPos - initialoffset;
content.css('background-position', 'center ' + totaloffset + 'px');
},
//Line 513
'bg_parallax' => array(
'title' => __( 'Background Parallax', 'fl-builder' ),
'fields' => array(
'bg_parallax_image' => array(
'type' => 'photo',
'show_remove' => true,
'label' => __( 'Photo', 'fl-builder' ),
'preview' => array(
'type' => 'none',
),
'connections' => array( 'photo' ),
),
'bg_parallax_speed' => array(
'type' => 'select',
'label' => __( 'Speed', 'fl-builder' ),
'default' => 'fast',
'options' => array(
'2' => __( 'Fast', 'fl-builder' ),
'5' => _x( 'Medium', 'Speed.', 'fl-builder' ),
'8' => __( 'Slow', 'fl-builder' ),
),
'preview' => array(
'type' => 'none',
),
),
'bg_parallax_offset' => array(
'type' => 'unit',
'label' => __( 'Image Offset', 'fl-builder' ),
'responsive' => true,
'default' => 0,
'slider' => array(
'min' => 0,
'max' => 1000,
'step' => 10,
),
'preview' => array(
'type' => 'none',
),
),
),
@iamandrewpeters
Copy link

Hey! Could you add a Read Me file to this by chance? Trying to get the parallax working on mobile and came across this in the FB group!

@MrFent
Copy link
Author

MrFent commented Jul 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment