【发布时间】:2020-03-30 05:10:20
【问题描述】:
我在左侧有一个网页侧导航菜单,在右侧有一个内容窗格。在内容窗格中有一个文本和一个 iframe。当通过带有选项卡的导航菜单并输入任何菜单选项时,将加载相关内容到内容窗格。即使加载到窗格选项卡焦点的内容也在导航菜单上。
每当新加载内容时,我需要将选项卡焦点赋予文本或内容窗格中的 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