- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试设置angular-intro
到目前为止,我已经完成了以下操作:
HTML:
<div class="hbox hbox-auto-xs hbox-auto-sm" ng-controller="ClientDashboardController">
<div class="row" ng-intro-options="IntroOptions" ng-intro-autostart="true">
<div class="col-lg-5 col-md-12" id="step1">
</div>
</div>
</div>
在我的 ClientDashboardController 中,我有以下内容:
$scope.IntroOptions = {
steps:[
{
element: '#step1',
intro: 'More features, more fun.',
position: 'left'
},
{
element: '#step2',
intro: "Another step.",
position: 'bottom'
},
],
showStepNumbers: false,
exitOnOverlayClick: true,
exitOnEsc:true,
nextLabel: '<strong>NEXT!</strong>',
prevLabel: '<span style="color:green">Previous</span>',
skipLabel: 'Exit',
doneLabel: 'Thanks'
};
但是在我的浏览器中我收到以下两个错误:
Error: [$compile:nonassign] Expression 'undefined' used with directive 'ngIntroOptions' is non-assignable!
http://errors.angularjs.org/1.3.14/$compile/nonassign?p0=undefined&p1=ngIntroOptions
at angular.js:63
at parentSet (angular.js:7661)
at parentValueWatch (angular.js:7674)
at Object.regularInterceptedExpression (angular.js:12852)
at Scope.$digest (angular.js:14235)
at angular.js:14440
at completeOutstandingRequest (angular.js:4905)
at angular.js:5285
还有:
TypeError: c.ngIntroMethod is not a function
at ng-intro.js:2
at angular.js:16223
at completeOutstandingRequest (angular.js:4905)
at angular.js:5285
谁能告诉我我做错了什么? :S
最佳答案
下面是来自ngIntro的工作示例文档。检查一下你的项目是否有问题。
var app = angular.module('myApp', ['angular-intro']);
app.controller('MyController', function ($scope) {
$scope.CompletedEvent = function (scope) {
console.log("Completed Event called");
};
$scope.ExitEvent = function (scope) {
console.log("Exit Event called");
};
$scope.ChangeEvent = function (targetElement, scope) {
console.log("Change Event called");
console.log(targetElement); //The target element
console.log(this); //The IntroJS object
};
$scope.BeforeChangeEvent = function (targetElement, scope) {
console.log("Before Change Event called");
console.log(targetElement);
};
$scope.AfterChangeEvent = function (targetElement, scope) {
console.log("After Change Event called");
console.log(targetElement);
};
$scope.IntroOptions = {
steps:[
{
element: document.querySelector('#step1'),
intro: "This is the first tooltip."
},
{
element: document.querySelectorAll('#step2')[0],
intro: "<strong>You</strong> can also <em>include</em> HTML",
position: 'right'
},
{
element: '#step3',
intro: 'More features, more fun.',
position: 'left'
},
{
element: '#step4',
intro: "Another step.",
position: 'bottom'
},
{
element: '#step5',
intro: 'Get it, use it.'
}
],
showStepNumbers: false,
exitOnOverlayClick: true,
exitOnEsc:true,
nextLabel: '<strong>NEXT!</strong>',
prevLabel: '<span style="color:green">Previous</span>',
skipLabel: 'Exit',
doneLabel: 'Thanks'
};
$scope.ShouldAutoStart = true;
});
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="https://rawgit.com/usablica/intro.js/master/minified/introjs.min.css" />
<script type="text/javascript" src="//rawgit.com/usablica/intro.js/master/minified/intro.min.js"></script>
<script data-require="angular.js@1.4.x" src="https://code.angularjs.org/1.4.8/angular.js" data-semver="1.4.8"></script>
<script src="//rawgit.com/mendhak/angular-intro.js/master/build/angular-intro.min.js"></script>
<script type="text/javascript" src="app.js"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MyController">
<div class="container-narrow">
<div ng-intro-options="IntroOptions" ng-intro-method="CallMe" ng-intro-oncomplete="CompletedEvent" ng-intro-onexit="ExitEvent" ng-intro-onchange="ChangeEvent" ng-intro-onbeforechange="BeforeChangeEvent" ng-intro-onafterchange="AfterChangeEvent" ng-intro-autostart="ShouldAutoStart">
<div class="masthead">
<ul id="step5" class="nav nav-pills pull-right">
<li><a href="https://github.com/mendhak/angular-intro.js/tree/master/build"><i class='icon-black icon-download-alt'></i> Download</a></li>
<li><a href="https://github.com/mendhak/angular-intro.js">Github</a></li>
</ul>
<h3 class="muted">ng-intro</h3>
</div>
<div class="jumbotron">
<h1 id="step1">Angular Intro.js</h1>
<p id="step4" class="lead">AngularJS directives for <a href="http://usablica.github.io/intro.js/" onclick="window.open(this.href);return false;">intro.js</a></p>
<a class="btn btn-large btn-success" ng-click="CallMe();">Demo</a>
<a class="btn btn-large btn-success" ng-click="CallMe(3);">Start at step 3</a>
</div>
<div class="row-fluid marketing">
<div id="step2" class="span6">
<h4>Setup</h4>
<p>Include the JS and CSS files for intro.js, and angular-intro.min.js. Add the module <code>angular-intro</code> to your app declaration.</p>
<h4>Options</h4>
<p>Set the options like so: <code>ng-intro-options="IntroOptions"</code>. Define <code>$scope.IntroOptions</code> in your controller. The format is exactly the same as the <a href="https://github.com/usablica/intro.js#options">original</a>.</p>
<h4>Method name</h4>
<p>Pick a method name, <code>ng-intro-method="CallMe"</code>. You can invoke the intro from elsewhere by calling <code>CallMe();</code>. You can also specify a step number using <code>CallMe(3);</code>. To autostart, use <code>ng-intro-autostart="true"</code></p>
<h4>Callbacks</h4>
<p>You can get callbacks to your controller using the <code>ng-intro-oncomplete</code>, <code>ng-intro-onexit</code>, <code>ng-intro-onchange</code>, <code>ng-intro-onbeforechange</code> and <code>ng-intro-onafterchange</code> directives.</p>
<p>See <a href="https://github.com/mendhak/angular-intro.js/blob/master/example/index.html">index.html</a> and <a href="https://github.com/mendhak/angular-intro.js/blob/master/example/app.js">app.js</a> for usage code.</p>
</div>
<div id="step3" class="span6">
<h4><a href="https://github.com/mendhak/angular-intro.js/tree/master/example">Example</a></h4>
<p>Set the options and method name:
</p>
<p>Options in the controller</p>
<p>Call it either way</p>
</div>
</div>
<hr>
</div>
</div>
</body>
</html>
关于javascript - 与指令 'undefined' 一起使用的 ng-intro 表达式 'ngIntroOptions' 是不可分配的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35157102/
我正在使用 introJS,我们的模板设计团队只能使用 data-intro 属性,但他们也使用选项卡和其他 javascript 来隐藏或显示某些元素。 当 introJS 运行时,对于那些隐藏元素
有没有办法显示 intro.js 的步骤的所有工具提示?一次游览而不是每次都经过? 最佳答案 您可以改用 Chardin.js。 关于intro.js - 一次显示所有 intro.js 导览步骤,我
我开始使用有用的 Intro.js库在我的项目中,但几个月后我更新了它,发现许可证在 2016 年 8 月 3 日发生了变化。 该库绝对是开源和免费软件,但同时如果我想将其用于商业用途似乎我need
我无法仅使用类 'case_event_intro' 启动元素介绍,但是当我执行 introJs(".case_event_intro").start(); 时没有任何反应,即使有具有该类和介绍 at
我需要在 video.mp4 开头添加 INTRO.mp4 并添加 watermark.png (右下角) 如何使用 ffmpeg 做到这一点,因为我迷路了? log file 最佳答案 复制并粘贴此
有没有一种方法可以自定义 intro js 中的项目符号,以便用户可以确定要跳到哪一步?我被问到项目符号是否可以有某种标识,以便用户在尝试访问特定组件的帮助时可以确定。 http://jsfiddle
我想要一个可以打开和关闭 intro.js 中的“提示”功能的按钮。 我有一个可以显示然后隐藏的工作版本,但该显示只能工作一次。我怎样才能让它反复工作?此功能适用于标准数据介绍,但不适用于数据提示。
我在我的网站上使用 intro.js 进行导览。我使用 bottom 作为默认的工具提示位置,但是有什么方法可以在游览开始后更改工具提示的位置吗? 这是我的代码: tourPluginObject=i
我正在尝试在 ionic 4 中实现 intro.js 但突出显示的文本不可见 enter image description here 这里是我如何在 Angular 7 中实现代码。 intro(
我已将 Intro.js 用于在我的网站中实现指南。虽然它工作得很好,但我遇到的问题是在为指南选择的 div 的左上角显示的小整数。 (附图) 此数字与应有的位置略有不同。请告诉我如何将它重新定位在中
我尝试在 meteor 元素上安装 intro.js: 我正在使用 bootstrap 3 和 meteor。我想知道元素的定位是否需要以不同的方式显示。 var intro = introJ
我正在使用 intro.js为我的网站创建一个小介绍。我希望导览从第 1(主页)-2(另一页)开始,然后返回到 1(主页)。 我已经成功地从第 1-2 页开始,但不确定如何让它返回到第 1 页。我对
我无法使用具有 class='test' 的特定元素启动 intro.js。我正在使用 Intro.js v0.9.0 。 根据文档,我按照以下方式编写了代码。 我试过这样开始intro
想要合并 intro.js 游览插件,但在 checkout 插件时,文档没有突出显示任何通过在游览部分外单击来防止游览关闭的方法。我宁愿有一个“结束游览”按钮,用户可以点击它来结束游览,而不是他们错
我在 my.bonify.de 有一个登机之旅.它提供与 introjs 类似的体验. 我们以非常丑陋的方式实现了这一点,使用了带有非常大的框阴影的 cutout div。我们想对此进行改进并使用像
我正在使用非常有趣的 javascript 库 intro.js . 但是,在我的应用程序中,突出显示的区域几乎变成了白色。 我猜这是一些 CSS 冲突,但我能做些什么来确定这个问题的原因呢? 最佳答
我们希望为网络应用程序提供一个通用的多页面导览以及特定于页面的导览。多页面正在运行,页面特定的也触发,但调用两个游览数据对象。有没有办法在同一页面上进行多个游览? function initTours
我最接近的是使用powershell Get-ChildItem given multiple -Filters Get-ChildItem -Include "Intro", "*.mp4" -Re
我已经实现了intro.js到我的网站。但我只想在第一次访问时开始旅行。可能是通过使用cookie..网站是用html而不是php制作的.. 最佳答案 JavaScript cookie 是一种解决方
仅供引用 - 如果有使用此插件的经验,这个问题可能更容易理解。 我正在使用intro.js在我的网页上建立一个交互式游览,并且在很大程度上它运行良好。在 options ,列出的API中,有disab
我是一名优秀的程序员,十分优秀!