Sliderman.js Error - Help

I am using example two of the Sliderman JS module found here
Sliderman.js - Examples - JavaScript Image Slider Library - Created by Devtrix

I have set this up to work in my aspx page and I am having issues in IE7&8, however, when I test in an HTML page it works fine. My IE debuggers is showing a JS error in the aspx page only.

Can someone please lead in the right direction as to why the same code is rendered differently between these two files? Shouldn’t they both work exactly the same?

Here is my aspx page (JS error in IE)
AffinityHotels aspx

Here is the same code (minus the UI) in an HTML page (no JS error in IE)
Sliderman.js - Examples - Created by

Thanks for any feedback. This is a weird one.

IE9 shows no error. Hang on, check advanced settings are to display notifications about script errors - nope, no problem there.

Testing in IE8 mode, and there’s the problem. Line 170 of the code.

function slideContainer(slidesContainer, display){
    container = newElement('div', {width: display.width, height: display.height, position: 'absolute', top: 0, left: 0, overflow: 'hidden'});
    return container;

Testing shows that the newElement() function has no trouble there, and the error occurs on that line, so it has to be the assignment. Why could that be?

Could it be that the container variable should not reach out beyond the function to make changes to a similar variable at a different scope?


var container = slideContainer(parameters.container, display);

There are a lot of different container variables at different scopes, so it seems that one is trying to clobber the other.
Let’s ensure that the container variable in the slideContainer remains in there:

function slideContainer(slidesContainer, display){
    var container = ...

It seems to work after that update.

This seems to be a genuine bug in the script, which we’re now fixed.

Hello paul_wilkins, I can not thank you enough for taking time to look at this problem. Your suggestion worked perfectly. Thanks!!

You’re welcome. I’ve notified the author about the bug, and pointed him here to this thread, so hopefully a fix will be in the works at some stage.

Good news - the plugin has now updated to 1.3.6 with the fix, so future downloads of it will be safe from having this same problem occurring.

Nice. Thanks!