Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with 2nd sliders on one page #261

Open
mvhoute opened this issue Apr 12, 2013 · 5 comments
Open

Problem with 2nd sliders on one page #261

mvhoute opened this issue Apr 12, 2013 · 5 comments

Comments

@mvhoute
Copy link

mvhoute commented Apr 12, 2013

I'm not sure if this is the right spot to ask it, but I give it a shot. I'm using Swipe.js (with .prev() and .next() elements) on a mobile website with Accordion elements. I noticed that the sliders went beserk when I loaded them directly (only on mobile!), so I've made the sliders dependent of the Accordion element. Like this:

 jQuery( "#accordion" ).accordion( {
    active: false, 
    collapsible: true,
    alwaysOpen: false,
    heightStyle: "content",   
    activate: function( event, ui ) {

        if ($('#slider1').length != 0) {
            window.mySwipe1 = new Swipe(document.getElementById('slider1'), {
              speed: 800,
              continuous: true,
              stopPropagation: false,
              callback: function(index, elem) {},
              transitionEnd: function(index, elem) {}
            });

        }

        if ($('#slider2').length != 0) {
            window.mySwipe2 = new Swipe(document.getElementById('slider2'), {
              speed: 800,
              continuous: true,
              stopPropagation: false,
              callback: function(index, elem) {},
              transitionEnd: function(index, elem) {}
            });

        }
  }
});

Now it seems to work a lot better, but on every page the second slider is having problems. It works fine when you either only swipe or only press the prev or next button, but when you combine the navigation the slides overlap.

I'm not getting any errors when I load the page. Any idea why this is happening?

@thebird
Copy link
Owner

thebird commented Apr 13, 2013

Throwing up a jsfiddle example would help debug.

@mvhoute
Copy link
Author

mvhoute commented Apr 15, 2013

Here's the Fiddle: http://jsfiddle.net/mvhoute/6qjHY/

Note: The problem ONLY occurs in a mobile browser (both iPhone and Android devices -> couldn't test it on Windows 8 mobile).

@alicelieutier
Copy link
Contributor

Can't reproduce this with the fiddle on my Android 4.0.3 (either on mobile chrome, android browser or NightlyFirefox)...
Do you have many images? Do you have a screenshot?

@mvhoute
Copy link
Author

mvhoute commented Apr 16, 2013

Here's a screenshot: http://i.imgur.com/NYQUrK6.png. There are now 10 images loaded in this specific slider. When this site goes live, it will contain a lot more images.

@denishams
Copy link

I am trying to use this slider twice in a page. In the 2nd slider picture not showing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants