Giter Club home page Giter Club logo

Comments (5)

brutaldesign avatar brutaldesign commented on June 28, 2024

Hey,

Which mobile device are you using?
The script has been tested on galaxy tab2, galaxy s2 and galaxy s3 for android

Pls let me know

Thx

from swipebox.

optimix-designer avatar optimix-designer commented on June 28, 2024

Hello,

Sorry, I was wrong, the Android version on my phone is Android 4.0.4 :)
I tested your plugin on Huawei Honor 2. I tried to record a screencast but unfortunately without success (not working app).

As I said in my first message the problem is that when I tap the buttons in footer (next, prev, close) the nav panels (both top and bottom) just fade out instead of opening next/prev slide or closing the gallery.

screenshot_2013-05-23-09-03-58

Thank you,

  • Alex

from swipebox.

donaldducky avatar donaldducky commented on June 28, 2024

Seems like click events are going through the buttons.

ie. click the X it closes the swipebox but then the click goes through to the next photo, opening the swipebox again.

Clicking the left/right arrows is making it register twice.

ie. click the right arrow and it goes forward 2 images instead of 1

I tested this on a Samsung Galaxy Nexus with Android 4.2.1

from swipebox.

donaldducky avatar donaldducky commented on June 28, 2024

It's because of this:

$('#swipebox-close').bind('click touchend', function(e){

They are bound to click and touchend...on Android both of them are firing. On an iphone it works fine.
Not sure how to properly handle these events cross-device...

Removing touchend, fixes the Android problem, though (but breaks the iphone).

from swipebox.

MartinEssink avatar MartinEssink commented on June 28, 2024

Fix:

var foo = (('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) ? 'touchstart' : 'click';

Plugin init:

plugin.init = function(){

            plugin.settings = $.extend({}, defaults, options);


            var foo = (('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch)) ? 'touchstart' : 'click';

            $selector.click(function(e){
                e.preventDefault();
                e.stopPropagation();
            });
            $selector.bind(foo, function(e){
                e.preventDefault();
                e.stopPropagation();
                index = $elem.index($(this));
                ui.target = $(e.target);
                ui.init(index);
            });
        }

Binding Events

$('#swipebox-prev').bind(foo, function(e){
                            e.preventDefault();
                            e.stopPropagation();
                            $this.getPrev();
                            $this.setTimeout();

                    });

                    $('#swipebox-next').bind(foo, function(e){

                            e.preventDefault();
                            e.stopPropagation();
                            $this.getNext();
                            $this.setTimeout();

                    });
                }

                $('#swipebox-close').bind(foo, function(e){ 

                        $this.closeSlide(); 
                });

from swipebox.

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.