/** * Add the JS for the excerpt to PostGrid's HTML output * * @access public * @since 1.0.0 * @param $existing_filter_output String - Any output already returned to this filter previously * @param $post_id String - the ID of the Brick where all the meta is saved. * @param $meta_prefix String - the prefix to put before each meta_field key to differentiate it from other plugins. :EG "postgrid" * @return $new_grid_output - the existing grid output with additional thigns added by this function. */ function mp_stacks_postgrid_excerpt_animation_js($existing_filter_output, $post_id, $meta_prefix) { if ($meta_prefix != 'postgrid') { return $existing_filter_output; } //Get JS output to animate the excerpts on mouse over and out $excerpt_animation_js = mp_core_js_mouse_over_animate_child('#mp-brick-' . $post_id . ' .mp-stacks-grid-item', '.mp-stacks-postgrid-item-excerpt-holder', mp_core_get_post_meta($post_id, 'postgrid_excerpt_animation_keyframes', array())); return $existing_filter_output .= $excerpt_animation_js; }
/** * Output the animation JS needed for grid item in the footer for each grid. * * @access public * @since 1.0.0 * @param $existing_grid_output String - All the output currently in the variable for this grid * @param $post_id String - the ID of the Brick where all the meta is saved. * @param $meta_prefix String - the prefix to put before each meta_field key to differentiate it from other plugins. :EG "postgrid" * @return $new_grid_output - the existing grid output with additional thigns added by this function. */ function mp_stacks_grid_animate_grid_items_js($existing_grid_output, $post_id, $meta_prefix) { //Get JS output to animate the images on mouse over and out $animation_js = mp_core_js_mouse_over_animate_child('#mp-brick-' . $post_id . ' .mp-stacks-grid-item', '.mp-stacks-grid-item-image', mp_core_get_post_meta($post_id, $meta_prefix . '_image_animation_keyframes', array())); //Get JS output to animate the images overlays on mouse over and out $animation_js .= mp_core_js_mouse_over_animate_child('#mp-brick-' . $post_id . ' .mp-stacks-grid-item', '.mp-stacks-grid-item-image-overlay', mp_core_get_post_meta($post_id, $meta_prefix . '_image_overlay_animation_keyframes', array())); //Get JS output to animate the background on mouse over and out $animation_js .= mp_core_js_mouse_over_animate_child('#mp-brick-' . $post_id . ' .mp-stacks-grid-item', '.mp-stacks-grid-item-inner', mp_core_get_post_meta($post_id, $meta_prefix . '_bg_animation_keyframes', array())); return $existing_grid_output . $animation_js; }