Javascript: Turning off mobile gestures on specific page

New Here ,
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

44

Likes

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
Adobe Community Professional ,
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

Likes

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
New Here ,
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 😄


Likes

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
Adobe Community Professional ,
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

Likes

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