Giter VIP home page Giter VIP logo

Comments (3)

asecondwill avatar asecondwill commented on July 20, 2024

Demo App:

https://github.com/asecondwill/demosliders

from foundation-rails.

asecondwill avatar asecondwill commented on July 20, 2024

I found the issue was that I was using jquery 1, which is the default with rails-jquery and the slider needs jquery 3 to be draggable on ios.

replace

//= require jquery

with

//= require jquery3

in application.js

from foundation-rails.

jackmorizo avatar jackmorizo commented on July 20, 2024

This happens because the jQuery code which calls the Element passes 2 parameters:

// ...
        dispatch: function(a) {
            a = n.event.fix(a);
            var b, c, d, f, g, h = [], i = e.call(arguments), j = (n._data(this, "events") || {})[a.type] || [], k = n.event.special[a.type] || {};
            if (i[0] = a,
            a.delegateTarget = this,
            !k.preDispatch || !1 !== k.preDispatch.call(this, a)) {
                h = n.event.handlers.call(this, a, j),
                b = 0;
                while ((f = h[b++]) && !a.isPropagationStopped()) {
                    a.currentTarget = f.elem,
                    c = 0;
                    while ((g = f.handlers[c++]) && !a.isImmediatePropagationStopped())
                        a.rnamespace && !a.rnamespace.test(g.namespace) || (a.handleObj = g,
                        a.data = g.data,
                        void 0 !== (d = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i)) && !1 === (a.result = d) && (a.preventDefault(),
                        a.stopPropagation()))
                }
                return k.postDispatch && k.postDispatch.call(this, a),
                a.result
            }
        },
// ...

Look at the (d = ((n.event.special[g.origType] || {}).handle || g.handler).apply(f.elem, i))

But in the Foundation.util.touch.js the handler passes only 1 parameter to the handleTouch function. unfortunately it passes the wrong parameter.

I propose you change:
https://github.com/foundation/foundation-sites/blob/develop/js/foundation.util.touch.js#L124
to:
$(el).bind('touchstart touchmove touchend touchcancel', function (elem, event) {

This would solve the Issue.

from foundation-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.