【问题标题】:Ng-Joyride not workingNg-Joyride 不工作
【发布时间】:2016-10-25 10:09:53
【问题描述】:

我目前正试图让ng-joyride 工作,但它实际上似乎并不想做我想做的事......

我有以下设置:

HTML:

<!--some content-->
<div class="hide" ng-joy-ride="$ctrl.startJoyRide" config="$ctrl.config" on-finish="$ctrl.onFinish()"  on-skip="$ctrl.onFinish()"></div>

<button type="button" class="btn btn-default" ng-click="$ctrl.test()">Start Joyride</button>

JS:

class Controller {

    constructor() {
        this.config = [
            {
                type: "title",
                heading: "Welcome to the NG-Joyride demo",
                text: '<div class="row"><div id="title-text" class="col-md-12"><span class="main-text">Welcome to <strong>Ng Joyride Demo</strong></span><br><span>( This demo will walk you through the features of Ng-Joyride. )</span><br/><br/><span class="small"><em>This can have custom html too !!!</em></span></div></div>'

            }
        ];
        this.startJoyRide = false;
    }

    test(){
        this.startJoyRide=true;
    }
}

export default Controller;

所以我有一个尽可能简单的配置,但是当我点击按钮时它根本没有显示任何东西......

另外(单击按钮时),我在控制台中遇到错误,说 $fkEl.size is not a function.

有没有人看到这里有错误,或者知道为什么它不起作用?

【问题讨论】:

    标签: javascript html angularjs zurb-joyride


    【解决方案1】:

    这已被注意到 - 但尚未修复 - 在这里:https://github.com/abhikmitra/ng-joyride/issues/67

    TL:DR;开发人员尚未将其更新为 jquery 3。

    在他这样做之前,您必须将 .size() 更改为 .length,并确保您使用的是早期版本的 jQuery——我使用的是 2.2.4——只是降级可能会有所不同。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 2014-06-24
      • 2014-09-12
      • 2017-01-18
      • 1970-01-01
      • 1970-01-01
      • 2014-01-22
      • 1970-01-01
      • 2017-12-05
      • 2017-03-18
      相关资源
      最近更新 更多