【发布时间】:2023-04-10 01:33:02
【问题描述】:
我制作了这个目录,它在 iframe 中显示产品的详细信息,点击后会显示。我的问题是当他们点击离开并且 iframe 关闭并且他们点击一个新项目时,过去的项目会显示一秒钟然后它会更改为正确的内容。我试图在加载内容之前加载一个空白 iframe,但这并没有完成工作,所以我想也许我必须添加一些代码,以便在点击离开 iframe 时清除它。
<script>
//this affect the content that is loaded in the iframe when image is clicked
$( document ).load( "pageinit", "#page1", function() {
$(".popupInfoLink").on("click", function(){
var url = $(this).data("popupurl");
$( "#popupInfo iframe" ).attr("src", url);
});
});
</script>
<a class="popupInfoLink" href="#popupInfo" data-rel="popup" data-position-to="window" data-popupurl="product.asp?itemid=[catalogid]"><img src= "/thumbnail.asp?file=[THUMBNAIL]&maxx=200&maxy=0" width="320" height="300" alt="pot" border="0" /></a>
<div data-role="popup" id="popupInfo" data-overlay-theme="a" data-theme="d" data-tolerance="15,15" class="ui-content">
<iframe src="about:blank" width="800px" height="800px"></iframe>
【问题讨论】:
标签: javascript jquery iframe history