在AngularJs的同一控制器中使用ng-intro-options构建多个游览?

时间:2016-07-29 10:19:43

标签: javascript angularjs intro.js

我希望使用Intro.js脚本构建多个信息导览,方法是将信息动态添加到DOM可见的div。这意味着我应该从$ scope中删除所有步骤元素。由元素值标识的DOM不可见的选项。

  $scope.Options = {
                steps:[

                    {
                        element: '#editableField',
                        intro: "test1",
                        position: 'left'
                    },
                    {
                        element: '#rowType',
                        intro: "test2",
                        position: 'right'
                    },

                ],
                showStepNumbers: false,
                exitOnOverlayClick: true,
                exitOnEsc:true,
                keyboardNavigation: true,
                showProgress: false,
                nextLabel: '<strong>Altro!</strong>',
                prevLabel: 'Precedente',
                skipLabel: 'Esci',
                doneLabel: 'Fatto'
            };

     function LoadIntroOptions()
        {  
          var options = $scope.Options;
          //here i want to remove all object from steps array in Options that are not visible to 'DOM' identified by element key.

       return options; //return needed options
        }

//Add needed Options to final object
$scope.IntroOptions=LoadIntroOptions();




Index.html



  <div ng-intro-options="IntroOptions" ng-intro-method="CallMe">
     <div id="editableField" ng-show="true"></div>
     <div id="rowType" ng-show="false"></div>
    </div>

0 个答案:

没有答案