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;
            };
        }
    

      

      

  • 相关阅读:
    深入学习Make命令和Makefile(上)
    make命令
    ubuntu 重启网络方法--通过杀死进程重启网络
    悟空遥控器 --- 手机投屏到电视 播放视频
    组织结构图 --- 商务
    软件和数据库
    因果图---鱼骨图
    流程图 --- BPMN规范简介
    异次元软件
    Free Download Manager (FDM) 中文版
  • 原文地址:https://www.cnblogs.com/iwen1992/p/14100932.html
Copyright © 2011-2022 走看看