Hello,
I have a landing page with Slider Revolution video and right below this my home page that has the menu and slide show. I have a scroll up button but it takes the user back to the landing page. How can I make it to take the user to the home page (where the menu is)?
My page is jiujitsuroswell.com
Thanks!
Hi,
To achieve that, you can add the code below in your child theme’s functions.php file.
function x_scroll_top_anchor() {
if ( x_get_option( 'x_footer_scroll_top_display' ) == '1' ) : ?>
<a class="x-scroll-top <?php echo x_get_option( 'x_footer_scroll_top_position' ); ?> fade" title="<?php esc_attr_e( 'Back to Top', '__x__' ); ?>">
<i class="x-icon-angle-up" data-x-icon=""></i>
</a>
<script>
jQuery(document).ready(function($) {
var sliderHeight = $('.x-slider-container.above').height();
var windowObj = $(window);
var body = $('body');
var bodyOffsetBottom = windowObj.scrollBottom(); // 1
var bodyHeightAdjustment = body.height() - bodyOffsetBottom; // 2
var bodyHeightAdjusted = body.height() - bodyHeightAdjustment; // 3
var scrollTopAnchor = $('.x-scroll-top');
function sizingUpdate(){
var bodyOffsetTop = windowObj.scrollTop();
if ( bodyOffsetTop > ( bodyHeightAdjusted * <?php echo x_get_option( 'x_footer_scroll_top_display_unit' ) / 100; ?> ) ) {
scrollTopAnchor.addClass('in');
} else {
scrollTopAnchor.removeClass('in');
}
}
windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
sizingUpdate();
scrollTopAnchor.click(function(){
$('html, body').animate({ scrollTop: 0 + sliderHeight }, 850, 'easeInOutExpo');
return false;
});
});
</script>
<?php endif;
}
add_action( 'x_after_site_end', 'x_scroll_top_anchor' );
Hope that helps.
Thanks, but there must be something wrong with the code you provided.
I did copy/paste and added it in the Functions.php of the Child and then got this error:
Parse error: Syntax error, unexpected end of file in …x-child/functions/php on line 64.
Hi There,
Would you mind providing us with login credentials(by clicking on the Secure Note button at the bottom) so we can take a closer look? To do this, you can make a post with the following info:
- Link to your site
- WordPress Admin username / password
- FTP credentials
Thanks.