Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: IFRAME HEIGHT ISSUE Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 27 December 2011 at 6:47am | IP Logged Quote kjmiami23

Hi,

I have add webmail in a iframe below my header but the issue i am having is how do i do auto resize with the browser?

I am struggling to because when the browser is using webmail the normal way without iframe it fixes to browser perfect and auto sizes etc.....
BUT when using iframes it a nightmare....how can i get round this?

does anyone have a script please?

Thanks.
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 27 December 2011 at 9:42am | IP Logged Quote Igor

You would have to calculate iframe height with JavaScript; take window height, substract height of other elements you have there and set the result value as iframe height. Most probably, you'd want to do that for window.onresize as well.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 28 December 2011 at 1:16am | IP Logged Quote kjmiami23

I am getting the 100% width fine it is the height it dont let me auto size to using javascript. Do you know a place where i can get script from please?

Thanks.
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 28 December 2011 at 1:55am | IP Logged Quote kjmiami23

i have attached a example of my iframe issue and i have attached my picture to the post for you to see. When you look at the picture there is a big white space below the webmail and it is not resizing the height to the full browser height.

click the link to view the image.

http://tinypic.com?ref=ogao49

Thanks.
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 28 December 2011 at 2:00am | IP Logged Quote kjmiami23

sorry here is correct link:

http://oi44.tinypic.com/33a9dsx.jpg
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
Corwin
Valued Community Member
Valued Community Member
Avatar

Joined: 16 March 2009
Location: Russian Federation
Online Status: Offline
Posts: 15
Posted: 28 December 2011 at 2:10am | IP Logged Quote Corwin

Igor is correct, and that's exactly how I did it in my project. Among JavaScript functions, I have the following cross-browser function to detect window height:

Code:
function winHeight() {
  return (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
}


I used 2 other functions for removing "px" and converting values to integer number:

Code:
function usize(str) {
  return(1 * str_replace("px","",str));
}

function str_replace(search, replace, subject) {
  subject=""+subject;
  return subject.split(search).join(replace);
}


With those functions, everything become easier to do. In my project I have footer and header containers, and Iframe in the middle. So I take full window height and do the calculations. Code called from body onload:

Code:
function frameUpdate() {
  frm=document.getElementById("iframe"); //find iframe by ID
  footer=document.getElementById("bottom"); //find footer by ID
  h1=usize(frm.offsetTop); //get header height
  h2=usize(footer.offsetHeight); //get footer height;
  h0=usize(winHeight()); //get total height
  frm.height=h0-h1-h2;
}
frameUpdate();
window.onresize=frameUpdate;


Works for me! And if you use JavaScript frameworks like jQuery in your code, you can find a simpler way to do this.

--
Cheers,
Corwin
Back to Top View Corwin's Profile Search for other posts by Corwin Visit Corwin's Homepage
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 28 December 2011 at 9:32am | IP Logged Quote kjmiami23

HI,

Ok HOW and WHERE do i copy this script to as i am new to this.


Thanks
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 28 December 2011 at 9:41pm | IP Logged Quote Igor

You would need to use such code in the part of your project where IFrame is defined. To ensure the code is run only when document is loaded in full, call your function(s) from:

Code:
<body onload="..."> ...


--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 29 December 2011 at 1:13am | IP Logged Quote kjmiami23

HI,

OK this is my iframe as it stands right now. What do i put where or copy where?

<html>
<head> </head>
<body>
<iframe src="http://www.mywebsite.com/mail" width="100%" height="100%"></iframe>
</body>
</html>

sorry to be a pain.

Thanks.
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 29 December 2011 at 1:33am | IP Logged Quote Igor

This is WebMail support forum. We can certainly provide some level of support for the product here, but what you're looking for is general help with web development, try searching for web forums on that subject.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 29 December 2011 at 6:26am | IP Logged Quote kjmiami23

If you can recommend me some places to look that would be great, as i dont want to be lookin in the wrong places.

Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
kjmiami23
Newbie
Newbie
Avatar

Joined: 25 June 2011
Location: United States
Online Status: Offline
Posts: 28
Posted: 30 December 2011 at 4:41am | IP Logged Quote kjmiami23

is there no other way apart from iframe the webmail can be implemented what about PHP includes or fopen?

can it be called that way?
Back to Top View kjmiami23's Profile Search for other posts by kjmiami23
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 30 December 2011 at 4:57am | IP Logged Quote Igor

Using IFrame is the only way to place WebMail into existing web application layout. Our tests show that WebMail expands to IFrame height just fine, so this is probably about setting height for IFrame itself. In this thread, you were already provided with an advanced way to do that.

If you require assistance with customizing WebMail Pro or integrating it into your web application, this can be done in terms of paid Professional Services contract. Basically, if you don't have skills to do the particular job, the logical choice is to hire a professional developer who does the job for you.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide