Scrolling Cart Script for a particular catalog item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2016 11:57 AM
Hi am trying this script for my catalog item that I got from the user community and I keep getting an error. Can someone take a look please?
Here is the link where I got the code from: Scrolling Cart for Service Request - Oslova Networks
Thank you,
Karen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2016 10:36 AM
Hi David,
If you don't mind 1 final time of reviewing the code that i have. It still is not scrolling when the page scrolls. I have NO Syntax errors (Awesome Sauce !). Just not sure why the "Order Now" button is not scrolling still. I did change the code to catch(e), and catch(e1).
var adder;
var cartContent;
function onLoad()
{
try
{
adder = gel('adder');
adder.style.position = "relative";
}
catch(e)
{
adder = '';
}
try
{
cartContent = gel('sc_cart_contents');
cartContent.style.position = "relative";
}
catch(e1)
{
cartContent = '';
}
window.onscroll = function()
{
try
{
var y = 12;
if (typeof window.pageYOffset != 'undefined')
y = window.pageYOffset;
else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0)
y = document.documentElement.scrollTop;
else if (typeof document.body.scrollTop != 'undefined')
y = document.body.scrollTop;
if (y > 60)
{
if (adder != '')
adder.style.top = y - 60 + 'px';
if (cartContent != '')
cartContent.style.top = y - 60 + 'px';
}
else
{
if (adder != '')
adder.style.top = 0 + 'px';
if (cartContent != '')
cartContent.style.top = 0 + 'px';
}
}
catch(e)
{
if (adder != '')
adder.style.top = 0;
if (cartContent != '')
cartContent.style.top = 0;
}
};
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2016 05:38 AM
HI Karen,
I'm not also sure that for Eureka it won't run or not. But please do the following things again as I say now (saying from the very beginning).
1. Please use the same code as I given above. Removing the function onLoad{}.
2. If it is not saving, Please comment the line cartContent = gel('sc_cart_contents') (under try)and save it. Again remove the comment and save it.
I hope this helps.Please mark correct/helpful based on impact

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-07-2016 05:40 AM
Amlan Pal, your code has errors and is improperly formatted. Please look over your code first before posting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2016 11:13 AM
Amlan,
The cart doesnt scroll in an iframe but it does scroll 'in the tool' is there a remedy to scroll in the iframe/cms view?