我有一个带有Iframe的页面。我使用以下代码来获取Iframe的大小:
<script language="javascript">
function sn()
{
alert('height is now '+document.getElementById("Iframemain").height)
alert('height is now '+document.getElementById("Iframemain").width)
}
</script>
<input type
我已经为我网站上的一些内容编写了自己的js/jquery代码。现在,iframe内部也有相同的内容,但是js/jquery只应用于没有iframe的内容。
对于这两种内容,我可以重新使用相同的代码吗?
例如,我希望这两种方法都适用。
$( ".myclass-price-info" ).appendTo( $( ".myclass-single" ) );
编辑:示例:我的页面上有一个普通的html
<div class="test"> This is test div </div>
然后我有相同的div里面,如果像下面这
基本上,我们使用的是gapphotos.com提供的服务,我们可以通过iframe将这些图像调用到我们的站点中。然后,此iFrame包含另一个包含图像的iframe。我遇到的问题是,他们的图像大致有两种大小: 161x161或320x320。我所要做的就是用jQuery进入这两个iFrames并改变其高度/宽度。
var f = $('#iFramePic1');
f.load(function() {
var iF = f.contents().find('iframe');
iF.load(function() {
iF.co
请帮我解决这个问题,我真的被困住了。我想嵌入一个特定的div(我知道ID),他的名字是:'content‘来自这个网站:我尝试了许多不同的方法,但没有结果,其中一个是这样的:
<script>
var iframe = document.getElementById("iframe");
var div = document.getElementById("PlaceToPutTable");
div.innerHTML = iframe.contentWindow.document.getElementById("content
<script language="JavaScript">
function autoResize(id){
alert('check');
var newheight;
var newwidth;
if(document.getElementById){
newheight=document.getElementById(id).contentWindow.document .body.