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 10-19-2003, 06:15 PM   PM User | #1
nicklim
New Coder

 
Join Date: Oct 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
nicklim is an unknown quantity at this point
using document.body.style.zoom & top.document.body.clientHeight

i use 2 javascript funcitons to automatically zoom and unzoom the document to the window size.

the function in the parent is

function zoom(){
var y=document.body.clientHeight;
var x=document.body.clientWidth;
factor=(((x/1010)<(y/670))? x/1010: y/670);
return document.body.style.zoom=factor;
}

and the function in the iframe content is

function unzoom(){
x = top.document.body.clientWidth;
y = top.document.body.clientWidth;
factor=(((x/1010)<(y/670))? 1010/x: 670/y);
return document.body.style.zoom=factor;
}

the reason why i call the unzoom function is to make sure that the text in the iframe does not become too big or too small, it works well on the first load, (both body and iframe content scales correctly) but after i click on the navigation bar (to cahnge the contents of the iframe), the iframe scales incorrectly, and i have to reload the page before it display correctly.

iframe's window.alert(x) returns the correct value the first time, and a value around 1000-1200 the after i click the navigation link.

navigation link function is by document.getElementById("content").src=link; (content is the id of the iframe)

I will appreciate if someone can give me a workaround to this problem.
nicklim 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 11:31 PM.


Advertisement
Log in to turn off these ads.