Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically Change Height of iFrame based on src content

Status
Not open for further replies.

cudofcow

Technical User
Mar 4, 2010
2
US
In the following code, you will see that i'm calculating the date to insert into a URL and sending that info to my iFrame. This part of my code works great. My next task is to find the scroll height of the content in the URL and send that to the iFrame in order to dynamically change the height of the iFrame based on the content height.

My question: How do i grab the URL content scroll height and pass the info along to the iFrame?


<script langauge="javascript" src="
<script language="javascript">
var $j=jQuery.noConflict();

$j(document).ready(function()
{
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
curr_month++;
var curr_year = d.getFullYear();
var formattedDate= curr_month + "/" + curr_date + "/" + curr_year;
$j("#myiframe").attr("src"," + "BeginDate=" + formattedDate + "&EndDate=" + formattedDate");

});
</script>
<iframe id="myiframe" scrolling="no" frameborder="0"></iframe>
 
Try this for a solution. The beauty is that the iframe content doesn't have to be on the same domain, although the caveat is that you must have access to put your own code within it.


Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top