我希望使用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>