Scrollable problem in IE 7-8 (IE 6?) + possible patch #557

Open
libraM opened this Issue Nov 10, 2011 · 2 comments

Projects

None yet

2 participants

@libraM
libraM commented Nov 10, 2011

scrollable.js 1.2.6, jQuery 1.2.6, Windows 7, Internet Explorer 9 in IE7/IE8 mode: error around line 295, something about setting undefined property.

I'm not sure at all that it's scrollable.js' problem, or that my patch (see below) is right for job,
but this quick fix helped me:

--- scrollable.js   (1.2.6)
+++ scrollable.js   Thu Nov 10 16:03:08 2011
@@ -290,15 +290,16 @@

        // touch event
        if (conf.touch) {
-           var touch = {};
+           var touch = {}
+             , item = (itemWrap.length > 0 ? itemWrap[0] : itemWrap);

-           itemWrap[0].ontouchstart = function(e) {
+           item.ontouchstart = function(e) {
                var t = e.touches[0];
                touch.x = t.clientX;
                touch.y = t.clientY;
            };

-           itemWrap[0].ontouchmove = function(e) {
+           item.ontouchmove = function(e) {

                // only deal with one finger
                if (e.touches.length == 1 && !itemWrap.is(":animated")) {           

Note, unmodified scrollable.js 1.2.6 runs in IE 9 (IE9 mode) perfectly well. (When patched, it runs in IE 9 perfectly well too ;-) )

@alibby251
Collaborator

Hi libraM,

Do you have any more details about the error please, and what this patch is meant to fix?

@libraM
libraM commented Dec 10, 2011

See patch: in IE 7-8, itemWrap[0] is undefined, so I added length check.

I don't care for touch support in IE 7-8, but I do care for IE <= 8 support - that's what my patch meant to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment