JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 1st, 2011, 01:35 PM
code_composer code_composer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 44 code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 21 m 3 sec
Reputation Power: 6
Issue With Setting DIV Height Based Upon Iframe Height In Chrome

I cannot get the iframe height in chrome, but I can get it in IE & FF. Can someone tell me where the issue is at in my code?

Code:
<script type="text/javascript">
function getContent()
{
// IE & FF
var frame_height_one = document.getElementById("my_iframe").contentWindow.document.body.scrollHeight;
document.getElementById("content_viewer").style.height = frame_height_one;
// Chrome & Safari
var frame_height_two = document.getElementById("my_iframe").contentDocument.document.body.scrollHeight;
document.getElementById("content_viewer").style.height = frame_height_two;
}
window.onload = function() {
getContent();
}
</script>


<div id="content_viewer">

<iframe id="my_iframe" src="iframe_page.html" width="100%" height="100%"></iframe>

</div>


I also tried this, but it didn't work either:

Code:
var frame_height_two = document.getElementById("my_iframe").contentDocument.body.scrollHeight;

Reply With Quote
  #2  
Old September 2nd, 2011, 10:27 AM
code_composer code_composer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 44 code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 21 m 3 sec
Reputation Power: 6
So does no one know how to do this? I am previewing these files locally, maybe Chrome has a security issue with me do that. Maybe that is why I cannot get this code to work. Does anyone have any input... at all?

Reply With Quote
  #3  
Old September 3rd, 2011, 10:26 PM
code_composer code_composer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 44 code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level)code_composer User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 21 m 3 sec
Reputation Power: 6
Does Chrome have an issue with doing this?

Reply With Quote
  #4  
Old September 4th, 2011, 04:08 AM
hdewantara's Avatar
hdewantara hdewantara is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2009
Location: Jakarta, Indonesia.
Posts: 151 hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level)hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level)hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level)hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level)hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level)hdewantara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Day 18 h 58 m 15 sec
Reputation Power: 30
Send a message via MSN to hdewantara
Perhaps just try not to test it locally, but served from a server ?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Issue With Setting DIV Height Based Upon Iframe Height In Chrome

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap