zoukankan      html  css  js  c++  java
  • introJs用法及在webkit内核浏览器的一个报错

    1、用法

    很简单的用法,引入js,引入css,再执行introJs().start();
    就可以了(备注:introJs会自动去抓取含有data-intro的dom在introJs源码中_introForElement有一段var allIntroSteps = targetElm.querySelectorAll("*[data-intro]"))
    所以只要在想要有引导的某个块元素加上data-intro=“这是一个引导文本”,理论上就可以实现,当然introJs有很多插槽可以供前端更好的去做一些事情,
    传送门https://www.lagou.com/lgeduarticle/94133.html

    2、报错TypeError: 'undefined' is not a function (near '...}.bind(this));...')

    bind()方法不存在,添加bind方法

    // 该webkit浏览器不支持bind方法,添加bind方法
          if (!Function.prototype.bind) {
            Function.prototype.bind = function(oThis) {
                if (typeof this !== "function") {
                    throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
                }
                var aArgs = Array.prototype.slice.call(arguments, 1),
                    fToBind = this,
                    fNOP = function() {},
                    fBound = function() {
                        return fToBind.apply(this instanceof fNOP && oThis ? this : oThis,
                            aArgs.concat(Array.prototype.slice.call(arguments)));
                    };
                fNOP.prototype = this.prototype;
                fBound.prototype = new fNOP();
                return fBound;
            };
        }
    

      

      

  • 相关阅读:
    Homebrew-macOS缺失的软件包管理器(简称brew)
    小程序setData工作原理理解图
    JS字符串转base64格式
    小小时钟带给我大大的思考-制作个时钟插件
    关键字屏蔽-正则
    图片(imageView)
    状态开关(ToggleButton)
    横向开关(switch)
    单选按钮(RadioButton)
    多选按钮(CheckBox)
  • 原文地址:https://www.cnblogs.com/iwen1992/p/14100932.html
Copyright © 2011-2022 走看看