Microsoft Windows Vista Community Forums - Vistaheads
Recommended Download



Welcome to the Microsoft Windows Vista Community Forums - Vistaheads, YOUR Largest Resource for Windows Vista related information.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so , join our community today!

If you have any problems with the registration process or your account login, please contact us.

Driver Scanner

Programatically using zoom vs Setting zoom level

microsoft.public.internetexplorer.general






Speedup My PC
Reply
  #1 (permalink)  
Old 03-11-2010
Jon Brown
 

Posts: n/a
Programatically using zoom vs Setting zoom level
Using IE 7 & 8, I need to supply buttons on a page to allow the user to zoom
in or out (I know they could simply user the browser to do this but.........
it’s a long story!!) Experimenting with ways to achieve this, I am having
difficulty achieving the same level of functionality when programmatically
applying a zoom as appears available using the browser menu.
On the very basic webpage below, if I use ctrl (+/-) to zoom the page, the
page content is resized correctly and everything if fine; However, if I apply
a zoom level by setting the .style.zoom property programmatically when
pressing the "Go" button, the zoom occurs but the contained paragraph is not
resized meaning that the text is now off the page and, despite setting the
overflow property to "auto" no scrollbar is present.
Am I omitting a step somewhere? Any help would be much appreciated!!


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<script>
function zoomIE()
{
var content = document.getElementById("content");
document.body.style.zoom = "1.2";
document.body.style.overflow = "auto";
content.style.overflow = "auto";
}
</script>
</head>

<div id="content">
<h2 id="pageName">Zoom</h2>
<input name="goButton" type="button" value="go" onclick="zoomIE();" />
<h3>Feature Title </h3>
<p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
molestie. Sed aliquam sem ut arcu. Phasellus sollicitudin. Vestibulum
condimentum facilisis nulla. In hac habitasse platea dictumst. Nulla nonummy.
Cras quis libero. Cras venenatis. Aliquam posuere lobortis pede. Nullam
fringilla urna id leo. Praesent aliquet pretium erat. Praesent non odio.
Pellentesque a magna a mauris vulputate lacinia. Aenean viverra. Class aptent
taciti sociosqu ad litora torquent per conubia nostra, per inceptos
hymenaeos. Aliquam lacus. Mauris magna eros, semper a, tempor et, rutrum et,
tortor. </p>
</div>

</div>
<br />
</body>
</html>

Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-11-2010
PA Bear [MS MVP]
 

Posts: n/a
Re: Programatically using zoom vs Setting zoom level
Developer-specific resources include:

MSDN IE Development Forum (post such questions here instead)
http://social.msdn.microsoft.com/For...opment/threads

Tip: When posting in Developer forums, always include a link to your web
site or test pages in your first post.

IE Developer Center
http://msdn.microsoft.com/en-us/ie/default.aspx

Learn IE8
http://msdn.microsoft.com/en-us/ie/aa740473.aspx

HTML and DHTML Overviews and Tutorials
http://msdn.microsoft.com/en-us/library/ms537623.aspx and

Cascading Style Sheets (CSS)
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

Expression Web SuperPreview for Internet Explorer (free, stand-alone visual
debugging tool for IE6, IE7, and IE8)
http://www.microsoft.com/downloads/d...b-dccff3fae677

Expression Web SuperPreview Release Notes
http://www.microsoft.com/expression/...easeNotes.aspx

Validators:
http://validator.w3.org/
http://jigsaw.w3.org/css-validator/


Jon Brown wrote:
> Using IE 7 & 8, I need to supply buttons on a page to allow the user to
> zoom
> in or out (I know they could simply user the browser to do this
> but.........
> it’s a long story!!) Experimenting with ways to achieve this, I am having
> difficulty achieving the same level of functionality when programmatically
> applying a zoom as appears available using the browser menu.
> On the very basic webpage below, if I use ctrl (+/-) to zoom the page, the
> page content is resized correctly and everything if fine; However, if I
> apply a zoom level by setting the .style.zoom property programmatically
> when
> pressing the "Go" button, the zoom occurs but the contained paragraph is
> not
> resized meaning that the text is now off the page and, despite setting the
> overflow property to "auto" no scrollbar is present.
> Am I omitting a step somewhere? Any help would be much appreciated!!

<SNIP>

Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE8 hangs when zoom level is not set to 100% ralexander microsoft.public.internetexplorer.general 1 02-19-2010 01:45
Zoom Setting Gene L. microsoft.public.windows.vista.mail 1 02-01-2010 13:47
zoom level button gone even after reinstalling ie7 lansur microsoft.public.internetexplorer.general 4 09-27-2008 12:59
print preview zoom level SBS user microsoft.public.internetexplorer.general 2 08-21-2008 16:07
zoom level news.verizon.net microsoft.public.windows.vista.general 2 08-20-2007 02:08




All times are GMT +1. The time now is 14:27.




Driver Scanner - Free Scan Now

Vistaheads.com is part of the Heads Network. See also XPHeads.com , Win7Heads.com and Win8Heads.com.


Design by Vjacheslav Trushkin for phpBBStyles.com.
Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.0 RC 2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120