我制作了这个计算器:
http://snuletek.org/arma2coordcalc/
我的网站上的 iframe 遇到问题。第一次输入一些坐标进行转换时,它工作正常,但如果您随后输入一些其他坐标,则必须按等于两次,iframe 才能更新。
这是一些示例坐标:
[151,[10504.9,2857.15,0.00293732]]
[5,[2645.41,1941.31,0.00133705]]
[40,[1565.65,2059.92,0.00142217]]
所以我的问题是,什么会导致这种行为?
最佳答案
您可以销毁整个 iframe 并重新加载它。这将导致它每次都加载。
在 js.js 文件中将加载代码更改为:
$('#mapUrl').fadeOut(400, function() {
height = $(document).height() * 0.8;
$('#mapUrl').remove();
$('<iframe id="mapUrl" src="'+getUrl+'" height="'+height+'"width="100%">').delay(200).appendTo('body').hide();
$('#mapUrl').delay(400).fadeIn(400);
});
关于javascript - 需要更新 iframe 两次才能正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13228682/