带有“书签”的 iframe没有主浏览器跳转?
我的主页上有几个 iframe,每个 iframe 都是 src=""。我设置了 jquery,这样当我单击按钮时,相关 iframe 的 src 就会填充为 website.com/#title1。
然而,我遇到的问题是,当 iframe 的浏览器窗口跳转到适当的行时,主浏览器会跳转到 iframe。当主浏览器忽略跳转时,如何让 iframe 完成“书签”的工作?
我已经阅读了前两个答案,但我不确定如何实现它。
我的 jquery 代码:
$("button.help_popup_button").click(function(e) {
e.preventDefault();
$("iframe", "div#help_popup_" + this.value).attr({
src : 'https://docs.djangoproject.com/en/dev/topics/templates/#filters',
});
});
我尝试过,但主浏览器仍然跳动
I have several iframes on my main page each of which are src="". I have jquery set up such that when a I click a button the src for the related iframe fills up to say website.com/#title1.
However, the problem I'm having is that when the iframe's browser window jumps to the appropriate line, the main browser jumps to the iframe. How can I have the iframe do its job with the "bookmark" while the main browser ignores the jump?
I've read the first 2 answers, but I'm kind of not sure how to implement it.
my jquery code:
$("button.help_popup_button").click(function(e) {
e.preventDefault();
$("iframe", "div#help_popup_" + this.value).attr({
src : 'https://docs.djangoproject.com/en/dev/topics/templates/#filters',
});
});
I tried that but the main browser still jumped
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)