Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-05-2012, 03:53 PM   PM User | #1
Sam_aindian
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Sam_aindian is an unknown quantity at this point
Internet Explorer Pagelets auto resize

Hi All,

We are facing an issue with pagelet resize.
We have iScript based pagelets. In iScript we will generate the URL of page and then will pass this URL to an iFrame.
Given Below is the iframe code.

<iframe id="%Bind(:2)" src="%Bind(:1)" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:block"> </iframe>

%Bind - are parameters that are passed dynamically

We need to resize the pagelet based on the content of the page.
We tried with the below function. It works some times. Sometimes it is unable to find the element in the page.

<html>


<script>
function resize(){
myFrame = document.getElementById("%Bind(:2)");
setInterval(function(){myFrame.heig ht = myFrame.contentWindow.document.body.scrollHeight}, 1);
}
</script>

<iframe id="%Bind(:2)" src="%Bind(:1)" onload="resize()" scrolling="no" marginwidth="0" marginheight="0"
frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:block"> </iframe>
</html>

Any idea on this?

We are running this code logic in IE7 and IE8. we are facing same issue in all the browsers.

Thanks for your time.
Regards,
SAM
Sam_aindian is offline   Reply With Quote
Old 12-05-2012, 08:42 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,578
Thanks: 62
Thanked 4,063 Times in 4,032 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Instead of showing us the iScript code, show us the actual HTML of the page.

Do this by bringing up the page in your browser, clicking on the VIEW menu, and then on the the SOURCE menu item.

That will show you the HTML (and script) as the browser sees it. Show *THAT* code to us.

Even better: Give us the URL of a live page where we may see this happening.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:26 AM.


Advertisement
Log in to turn off these ads.