将标签页焦点转移到新加载的页面angularJS

问题描述 投票:0回答:1

我在左侧有一个网页侧边的导航菜单,在右侧是内容窗格。在内容窗格中有一个文本和一个iframe。当通过带有tab的导航菜单并输入任何菜单选项时,相关内容将被加载到内容窗格。即使加载到窗格选项卡焦点的内容也位于导航菜单上。

[每当新加载内容时,我都需要将标签焦点放在内容窗格中的文本或iframe上。我尝试使用tabindex ..

<a href="" tabindex="1">test text for tab focus</a>
<div id="content-frame" class="fill center-content">   

    <div id="content-frame-loading" class="load-img"><img ng-src="{{loadingIconUrl}}" alt="{{$scope.loadingSpinnerAltText}}"></div>

    <iframe id="centerIframe" name="centerIframe" class="fill content-frame"  src="" orientable height="100%" width="100%" ng-style="{'height' : settings.iFrameHeight}" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen="true" allowtransparency="true">
    </iframe>

</div>

上面是内容窗格的代码块。

javascript html angularjs focus tabindex
1个回答
0
投票

仅设置tabindex不能解决目的。 tabindex将把dom节点添加到制表序列中,并根据该序列轮到on click click tab

© www.soinside.com 2019 - 2024. All rights reserved.