• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Javascript: Turning off mobile gestures on specific page

Community Beginner ,
Dec 04, 2020 Dec 04, 2020

Copy link to clipboard

Copied

I've added some of my own HTML elements to a course, this works fine when mobile gestures are off. But when they are on the elements cannot be clicked. I'm hoping to be able to turn this feature off for a specific slide if it's possible to get at that property. 

 

This is the portion of CPM.js that is added when this feature is enabled, does anyone know how b.defaults.stop_browser_behavior can be changed by Javascript?

 

(function (im) {
  var b = function (ac) {
    return new b.Instance(ac || {});
  };
  b.defaults = {
    stop_browser_behavior: {
      userSelect: "none",
      touchAction: "none",
      touchCallout: "none",
      contentZooming: "none",
      userDrag: "none",
      tapHighlightColor: "rgba(0,0,0,0)",
    },
  };
  b.HAS_POINTEREVENTS =
    i.navigator.pointerEnabled || i.navigator.msPointerEnabled;
  b.HAS_TOUCHEVENTS = "ontouchstart" in i;
  b.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android|silk/i;
  b.NO_MOUSEEVENTS =
    b.HAS_TOUCHEVENTS && i.navigator.userAgent.match(b.MOBILE_REGEX);
  b.EVENT_TYPES = {};
  b.DIRECTION_DOWN = "down";
  b.DIRECTION_LEFT = "left";
  b.DIRECTION_UP = "up";
  b.DIRECTION_RIGHT = "right";
  b.POINTER_MOUSE = "mouse";
  b.POINTER_TOUCH = "touch";
  b.POINTER_PEN = "pen";
  b.EVENT_START = "start";
  b.EVENT_MOVE = "move";
  b.EVENT_END = "end";
  b.DOCUMENT = i.document;
  b.plugins = b.plugins || {};
  b.gestures = b.gestures || {};
  b.READY = !1;
  b.utils = {
    extend: function (abd) {
      for (var e in b) (a[e] !== m && d) || (a[e] = b[e]);
      return a;
    },
    each: function (abd) {
      var ef;
  etc etc
    },
  };
  "function" == typeof define && define.amd
    ? define(function () {
        return b;
      })
    : "object" === typeof module && module.exports
    ? (module.exports = b)
    : (i.Hammer = b);
})(window);

Views

106

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2020 Dec 06, 2020

Copy link to clipboard

Copied

Perhaps I don't fully understand the problem but each slide does have a check box in the Properties Inspector to Allow Gesture Navigation. On a slide by slide basis, this can be unchecked. 2020-12-06_4-34-13.png

 

Paul Wilson, CTDP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

Ha ha wow that is a good solution, thank you!! Can't believe I didn't even check properly, must be too overworked 😄


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2020 Dec 07, 2020

Copy link to clipboard

Copied

LATEST

Yeah as a 15 year veteran with Captivate I'm pleased but slightly embarrassed when I learn something that I should have known before. Happens to all of us. 

Paul Wilson, CTDP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources