I'm trying to change the height of a div id inside in iFrame from 226px to 660px. Yes, the iFrame source is from the same domain.
I'm trying to select div id dojox_grid__View_1
inside iFrame id finesse_gadget_1
. I've tried the solution with the highest votes from here:
But it didn't work. So, I ran this command:
console.log($("iframe#finesse_gadget_1").contents().find("#dojox_grid__View_1"));
And this is the result:
jQuery.fn.init [div#dojox_grid__View_1.dojoxGridView, prevObject: jQuery.fn.init(1), context: document, selector: "#dojox_grid__View_1"]
But, I don't understand what it means?
This is the HTML:
<div id="finesse-container">
<div id="finesse-gadgets-workspace">
<div id="panel_home">
<iframe id="finesse_gadget_1">
<html><body>
<div id="teamBody">
<div id="teamRoster">
<div id="hideFocus">
<div id="dojoxGridMasterView">
<div id="dojox_grid__View_1" style="height: 226px;"></div>
</div>
</div>
</div>
</div>
</body></html>
</iframe>
</div>
</div>
</div>
The only way I can successfully select the iFrame is like this (document.getElementById
didn't work):
$('iframe#finesse_gadget_1', parent.document.body)
Here's the code that I've tried, without success:
var iFrame = $('iframe#finesse_gadget_1', parent.document.body);
var iFrameDocument = iFrame.contentDocument || iFrame.contentWindow.document;
var iFrameContent = iFrameDocument.getElementById('#dojox_grid__View_1');
iFrameContent.height(660 + 'px');
I've also tried this, without success:
$('iframe#finesse_gadget_1', parent.document.body).contents().find('div#dojox_grid__View_1').height(660 + 'px');
Any help is greatly appreciated!