Git Product home page Git Product logo

Comments (16)

tylernotfound avatar tylernotfound commented on August 15, 2024

Noted. Will keep this in mind for the next release.

from flexslider.

tmikaeld avatar tmikaeld commented on August 15, 2024

Any hint's on where to look to disable this?

I made the mistake of putting too much time into basing my design on this slider, can't really go back ;-)

from flexslider.

tylernotfound avatar tylernotfound commented on August 15, 2024

The problem is that you don't want to disable touch, but you would like to validate before allowing the touch event to happen, correct?

Fully disabling touch is easy, but this would take a little more doing.

from flexslider.

tmikaeld avatar tmikaeld commented on August 15, 2024

Running a function that can stop the slide would be optimal yes.

But a temporary quick-disable would be great :-)

from flexslider.

tylernotfound avatar tylernotfound commented on August 15, 2024

Comment out lines 261 - 332 in jquery.flexslider.js. That is the touch functionality.

To add your logic, you would add it to the onTouchStart function and prevent/enable the addEventListenter for touchMove and touchEnd. Hopefully that makes sense.

from flexslider.

tmikaeld avatar tmikaeld commented on August 15, 2024

I'm trying to disable it without changing the code, since i'm using the slider on several pages.
I tried adding this to the before () function, but it seem to disable all sliding on mobiles (even buttons).
Work's fine on desktop though.

    before: function(slider) {
        slider.each(function() {
          if ('ontouchstart' in document.documentElement) {
            this.removeEventListener('touchmove', onTouchMove, false);
            this.removeEventListener('touchend', onTouchEnd, false);
          }
        });
        },

Any suggestion on how to disable it without removing code?

from flexslider.

tylernotfound avatar tylernotfound commented on August 15, 2024

You're requirements are too specific to avoid messing with the core, as I see it. The before function isn't called when you touch the slider, only when they let go and it decides where it needs to go.

from flexslider.

tmikaeld avatar tmikaeld commented on August 15, 2024

Ok, thanks for the support. I'll go with two flexslider files until there's a proper setting for this. Thanks again for a great plugin!

from flexslider.

dappi avatar dappi commented on August 15, 2024

Have this feature added to flexslider? I would need something similar: user needs to do something before (s)he can go to next slide. And on next slide same thing again. I didn't find anything touch related on lines lines 261 - 332 like was suggested earlier.

from flexslider.

farrukh-saeed-dev avatar farrukh-saeed-dev commented on August 15, 2024

I found this simple solution. Use

touch: false,

worked for me though.

from flexslider.

sathiyaVGE avatar sathiyaVGE commented on August 15, 2024

I have drag and drop quiz in my slide page. My requirement is to disable slider swipe on touch. How do disable touch dynamically? I used the below code but it is not working. Any solution would be of great help. Thank you in advance.

$( ".drag" ).draggable({
revert: "invalid",
helper: "clone",
//cursorAt: {left:50},
cursor: "move",
start: function( event, ui ) {
//alert("started");
$ci_content.flexslider({
touch:false
});
},
stop: function( event, ui ) {
//alert("stopped");
$ci_content.flexslider({
touch:true
});
}
});

from flexslider.

uili avatar uili commented on August 15, 2024

Looking for the same thing.. How do disable touch dynamically?

from flexslider.

sathiyaVGE avatar sathiyaVGE commented on August 15, 2024

Hi uili,
I done that with the help of flag variable, when it is set to 1.
I will go to events(touchstart , touchmove and touchend) in flexslider and put condition there like
if(dragFlag == 1){
return;
}
Have to put it in three places

from flexslider.

uiliw avatar uiliw commented on August 15, 2024

Yeap, thanks for taking me to the right direction, this worked for me! but the main idea would be not to change the core!!

from flexslider.

sathiyaVGE avatar sathiyaVGE commented on August 15, 2024

@uili : Can you suggest me something without changing the core, did you find any other solution. It would be great if I find some other solution

from flexslider.

uiliw avatar uiliw commented on August 15, 2024

@sathiyaVGE : I could not find any other solution, the way you did had suited my needs, but ill keep looking for something else, and update this post if i find!

from flexslider.

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.