Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

How to dynamically adjust an iframe’s height on click event Poll - This thread contains a Poll. First mark your answer from the options and then reply with your justification.
Question: How to dynamically adjust an iframe’s height on click event
problem in javescript - 0 (0%)
problem in function call - 0 (0%)
Total Voters: 0

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

How to dynamically adjust an iframe’s height on click event

 
webmaster forum
aghasoft  Offline
Activity
0%
 
New Poster
Posts: 2
Topics: 1
July 29, 2011, 05:16:08 AM

hi i am in trouble i need emergency help

i need ifram auto height adjust on menu click event.

i had all done same like hxxp: www. mattcutts. com/blog/iframe-height-scrollbar-example/

that is help i had used.

now that is no page load.

when i use it on click event it did not work first time.  and did not restore small height if i call small content page.

this is my link

hxxp: bestforexguide. co. cc/demo/iframtest/
 
webmaster forum
aghasoft  Offline
Activity
0%
 
New Poster
Posts: 2
Topics: 1
July 29, 2011, 05:54:03 AM

<script type="text/javascript">
// Firefox worked fine.  Internet Explorer shows scrollbar because of frameborder
function resizeFrame(f) {

f. style. height = f. contentWindow. document. body. scrollHeight + "px";

}
</script>

<body onload="resizeFrame(document. getElementById('child frame'))">


<li onclick="resizeFrame(document. getElementById('chil dframe'))"><a href="welcome. html" target="childframe" >Welcome</a></li>
<li onclick="resizeFrame(document. getElementById('chil dframe'))"><a href="weddingevents. html" target="childframe" >Wedding Events</a></li>

<iframe frameborder=0 border=0 src="welcome. html" name="childframe" id="childframe" width="603" style="background-color:#FFF;">
</iframe>
 
webmaster forum
netshet  Offline
Activity
0%
 
Regular Coder
Posts: 73
Topics: 2
WWW
August 06, 2011, 02:07:22 AM

this solution will only work:

    if you have control over the content of BOTH pages (the "outer" page with the IFRAME tag, and the "inner " page being displayed in the IFRAME)
    if the outer and inner pages are being hosted on the same domain (and it's a little less work if they are on the same server)

The solution has two basic steps:

    measure the height of the IFrame's content once the content has loaded
    set the height of the IFrame to the height of the content

First, let's assume this is your IFrame tag:

<IFRAME
    src="http://myhost.mydomain.com/innerpage.html">

hair transplant
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 05, 2012, 11:52:43 AM