Jump to content

AJAX cart summary scroll


Recommended Posts

I've been testing the new AJAX cart and I found that the scrolling summary is not working so well with custom layouts. On Chromium for instance it tends to be positioned outside of the screen whenever you scroll and on FF 4 there are some problems with resizing the window and then trying to scroll. In addition to that it uses the JQuery scroll event handler without a throttling mechanism in place which causes my Core i5 to spike from 6% CPU to almost 30% whenever I scroll. I have made some modifications to main.js in the templates/orderform/ajaxcart/js folder and I figured this might help somebody else so I'm attaching it to this post. I've used this tutorial http://css-tricks.com/examples/ScrollingSidebar/index.php and modified it to use the JQuery throttle plugin from here http://benalman.com/projects/jquery-throttle-debounce-plugin/ I've embedded the plug-in code within the main.js file so all you need to do is replace your main.js with the one attached here. This change causes the scroll event to only execute the code once every 250ms (configurable) so it will go easy on your clients machines.

main.js.zip

Link to comment
Share on other sites

  • 1 year later...

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