Jump to content

Recommended Posts

Hello,

 

I come to you to see if anyone is how the scroll Stope at some point.

 

I joined the js code, in hope to have your help

 

thank you in advance

 

cordially

 

	$(document).ready(function () {	
		var $orderSummaryEl = jQuery("#scroll");
		if ($orderSummaryEl.length) {
			var offset = jQuery("#scrollingPanelContainer").parent('.row').offset();
			//var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35;
			var maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row');
			var topPadding = 15;
			jQuery(window).resize(function() {
				offset = jQuery("#scrollingPanelContainer").parent('.row').offset();
				//maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row').outerHeight() - 35;
				maxTopOffset = jQuery("#scrollingPanelContainer").parent('.row');
				repositionScrollingSidebar();
			});
			jQuery(window).scroll(function() {
				repositionScrollingSidebar();
			});
			repositionScrollingSidebar();
		}

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

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.

×
×
  • 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