【发布时间】:2014-05-23 15:35:44
【问题描述】:
我有这个简单的 iframe:
<iframe src='http://edition.cnn.com/2014/05/23/world/asia/thai-coup-color-day-2/index.html?hpt=hp_c1#cnnContentContainer' class='ExFrame' id='ifr' style='width:100%;height:500px;' scrolling='yes'>
但是当我加载页面时,iframe 获得了焦点。有可能防止这种情况吗? 我试过这个:
$("#ifr").blur();
没有运气......
编辑:我想在 iframe 的 url 中使用 #ID
【问题讨论】:
-
我不知道这是否有帮助:stackoverflow.com/questions/7208064/…
-
你怎么知道它占据了焦点?
-
我认为问题可能与您使用的 src 有关(该页面的 javascript 中可能有一些魔法)。
-
@AlexThomas 看到页面滚动
-
看看是否符合您的需求:jsfiddle.net/X8CE8/1
标签: javascript jquery html css