Jump to content

Scrolling Panel Container in cart Bug


sebsimappus

Recommended Posts

Hello

 

For some days I am looking for a solution to my problem, the scroll does not stop before the footer: see screen prints.

 

Sans titre.jpg

 

By cons when I reduce the page, and I enlarge the page it works perfectly with the function, repositionScrollingSidebar

 

$(document).ready(function () {

var $cartsummaryEl = jQuery("#cartsummary");
if ($cartsummaryEl.length) {
	var offset = jQuery("#scrollingPanelContainer").parent('.row').offset();
	//var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35;
	var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row');

	var topPadding = 70;
	jQuery(window).resize(function() {
		offset = jQuery("#scrollingPanelContainer").parent('.row').offset();
		maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35;
		repositionScrollingSidebar();
	});
	jQuery(window).scroll(function() {
		repositionScrollingSidebar();
	});
	repositionScrollingSidebar();
}

function repositionScrollingSidebar() {
	if (jQuery("#scrollingPanelContainer").css('float') != 'left') {
		$cartsummaryEl.stop().css('margin-top', '0');
		return false;
	}
	var heightOfcartsummary =  $cartsummaryEl.outerHeight();
	var newTopOffset = jQuery(window).scrollTop() - offset.top + topPadding;
	if (newTopOffset > maxTopOffset - heightOfcartsummary) {
		newTopOffset = maxTopOffset - heightOfcartsummary;
	}
	if (jQuery(window).scrollTop() > offset.top) {
		$cartsummaryEl.stop().animate({
			marginTop: newTopOffset
		});
	} else {
		$cartsummaryEl.stop().animate({
			marginTop: 0
		});
	}
}
}); 

 

If someone has an idea

 

thank you in advance

Edited by sebsimappus
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated