• From wp-content/themes/bento/includes/js/theme-scripts.js:

    
    if ( window.location.hash ) {
    	var bento_cleanhash = window.location.hash.substr(1);
    	if ( $str('#' + bento_cleanhash).length ) {
    		if ( bentoThemeVars.fixed_menu == 1 ) {
    			var bento_headerHeight = $str('.site-header').outerHeight(true);
    		}
    		scrollPosition = $str('#' + bento_cleanhash).offset().top - bento_headerHeight - 10;
    		$str('html, body').animate( { scrollTop: scrollPosition }, 1 );
    	}
    }
    

    This fails when fixed_menu != 1

    • This topic was modified 6 years, 8 months ago by mastokley.
    • This topic was modified 6 years, 8 months ago by mastokley.
Viewing 1 replies (of 1 total)
  • Theme Author satoristudio

    (@satoristudio)

    Hey @mastokley,

    thanks for reporting! Just encountered the same issue in this recent ticket, the theme update is on its way (the theme queue has been moving abnormally slowly for the last couple of weeks).

    Meanwhile, if you’re comfortable with editing code, you can replace that function with this one (will be included into the next update, so safe to edit on the parent theme):

    // Scroll to the correct position for hash URLs
    	if ( window.location.hash ) {
    		var bento_cleanhash = window.location.hash.substr(1);
    		if ( $str('#' + bento_cleanhash).length ) {
    			var bento_headerHeight = 0;
    			if ( bentoThemeVars.fixed_menu == 1 ) {
    				bento_headerHeight = $str('.site-header').outerHeight(true);
    			}
    			scrollPosition = $str('#' + bento_cleanhash).offset().top - bento_headerHeight - 10;
    			$str('html, body').animate( { scrollTop: scrollPosition }, 1 );
    		}
    	}

    Otherwise, I can send you a direct download link for the theme incl. the fix.

    Sincerely,
    Andrii / Satori Studio

Viewing 1 replies (of 1 total)
  • The topic ‘Jump links scrolling busted when header not fixed’ is closed to new replies.