我使用了以下游览指令。
<tour step="currentStep"
<span tourtip="Few more steps to go."
tourtip-next-label="Close"
tourtip-placement="bottom"
tourtip-offset="80"
tourtip-step="0">
</span>
</tour>
问题1:如何让整个项目可以点击?换句话说,如果用户点击,它应该打开一个弹出窗口或类似的东西。
问题 2:如果游览项目已打开,单击页面上的任意位置会关闭该游览项目吗?
任何帮助将不胜感激。
最佳答案
您可以将 ng-if
指令与自定义指令(我称之为切换器)结合使用,这将相应地设置 ng-if
所依赖的值根据您的需要,例如:
<tour toggler step="currentStep"
<span ng-if="open" tourtip="Few more steps to go."
tourtip-next-label="Close"
tourtip-placement="bottom"
tourtip-offset="80"
tourtip-step="0">
</span>
</tour>
当有人点击 tour
元素时,toggler
指令会将 open
值设置为 true
,并且当有人点击 tour
元素之外的任何位置,open
值将被设置为 false
,从而使 ng-if
指令隐藏元素。
这是 plunker与实现。
关于javascript - Angular Tour 指令问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29318902/