By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Is there a way to stretch an HTML body?

P: n/a
Hello!

I'm looking for a way to stretch an HTML page.

I found a way to zoom into a web page by using this code:
body.style.zoom = 200%. (this piece of code magnifies the page 2 times
larger)

By following this way, the whole HTML page will be zoomed BUT in a
PROPORTIONAL way.

What actually i'm looking for is stretching the page. What i mean by
stretching is: stretching the width of the page by a factor X and the
height of the page by a factor Y and not doing it proportionally as
what will be done by using the ZOOM.

I know the web page will look distorted but i can get with that!

Thanks in advance!

Jan 13 '06 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Zeez wrote on 13 jan 2006 in comp.lang.javascript:
Hello!

I'm looking for a way to stretch an HTML page.

I found a way to zoom into a web page by using this code:
body.style.zoom = 200%. (this piece of code magnifies the page 2 times
larger)
IE only!!!
By following this way, the whole HTML page will be zoomed BUT in a
PROPORTIONAL way.
No, not with javascript.
What actually i'm looking for is stretching the page. What i mean by
stretching is: stretching the width of the page by a factor X and the
height of the page by a factor Y and not doing it proportionally as
what will be done by using the ZOOM.

I know the web page will look distorted but i can get with that!


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 13 '06 #2

P: n/a
Thanks for the quick reply.

Ok, so do u know if this is possible in any other way? If yes, any
examples or links?

Thank You

Jan 13 '06 #3

P: n/a
Zeez wrote on 13 jan 2006 in comp.lang.javascript:
Thanks for the quick reply.

Ok, so do u know if this is possible in any other way? If yes, any
examples or links?


This is usenet, not email.

If you don't quote relevent part of what you are replying on,
we won't know what you are talking about.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 13 '06 #4

P: n/a
JRS: In article <Xn********************@194.109.133.242>, dated Fri, 13
Jan 2006 08:33:42 local, seen in news:comp.lang.javascript, Evertjan.
<ex**************@interxnl.net> posted :
Zeez wrote on 13 jan 2006 in comp.lang.javascript:

I found a way to zoom into a web page by using this code:
body.style.zoom = 200%. (this piece of code magnifies the page 2 times
larger)


IE only!!!


Perhaps "some IE only!!!" ??

The following, executed in js-index.htm or otherwise, may be useful for
those with good eyesight & monitors ...

for (J in document.body.style) document.writeln(J, "<br>")
document.body.style.fontSize = 11

It tells how to do things, for the current browser, with some clue as to
what they may be.

I don't recall how one can read the current settings of those (such as
cursor ).

There's nothing for asymmetrical zoom, AFAICS; that's a pity, because
programmed linear transformations (such as can be done in Windows Paint
and IIRC PostScript) could be very useful.

I once had an application which could squash fonts horizontally; Courier
squashed 60% can be very readable for the area it takes up.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jan 14 '06 #5

P: n/a
On 2006-01-14, Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:

for (J in document.body.style) document.writeln(J, "<br>")
document.body.style.fontSize = 11

It tells how to do things, for the current browser, with some clue as to
what they may be.

I don't recall how one can read the current settings of those (such as
cursor ).


for (J in document.body.style){
document.writeln(J,"->",document.body.style[J],<br>);
}

same as any other for-in loop

Bye.
Jasen
Jan 15 '06 #6

P: n/a
Jasen Betts wrote on 15 jan 2006 in comp.lang.javascript:
for (J in document.body.style){
document.writeln(J,"->",document.body.style[J],<br>);
}


As the style only is available in the DOM when the pagebuild is finished,
how would a document.write not destroy those styles?
Only the first one is shown.

try:

========= test.html =========
<body style='height:500px;' onload='x()'>

<script type="text/JavaScript">
var b = document.body
function x(){
for (J in b.style)
b.innerHTML += J + " -> " + b.style[J] + "<br>"
}
</script>
=============================

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 15 '06 #7

P: n/a
VK
OP can use (IE-only, IE 5.5 or higher) very powerful Matrix filter:
<http://msdn.microsoft.com/workshop/author/filter/reference/filters/matrix.asp>

A sample follows below (watch line breaks). Also remember that IE is
still a desktop application, not a DirectX game builder. Therefore all
these filters are rather resource expensive, say a JScript-based Quake
Arena won't fly (yet?) ;-)

For similar effect in Gecko and Opera the only option (yet?) is to
design the whole page in SVG and apply SVG transformations on it.

<html>
<head>
<title>Matrix filter</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/Jscript">
var flt = "progid:DXImageTransform.Microsoft.Matrix";
flt+= "(M11=2,M12=0,DX=0,M21=0,M22=1,DY=0,FilterType=bil inear)";

function demo() {
document.body.style.filter = flt;
}

window.onload = demo;
</script>
<style type="text/css">
body {
font: 1.2em "Times New Roman", Times, serif;
background-color: #FFFFFF;
margin: 0px 0px;
padding: 10px 10px;
width: 100%;
}
</style>
</head>

<body>

<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,

sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

</body>
</html>

Jan 15 '06 #8

P: n/a
VK wrote on 15 jan 2006 in comp.lang.javascript:
OP can use (IE-only, IE 5.5 or higher) very powerful Matrix filter:
....


Are you anwering on something?

Please quote relevant part.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 15 '06 #9

P: n/a
VK

Evertjan. wrote:
Are you anwering on something?

Please quote relevant part.


Please do *not* quote while explaining newsgroup quote rules.
;-)

Google Search still gives the right thread:
<http://groups.google.com/groups?hl=en&lr=&safe=off&num=10&q=matrix+filter+g roup%3Acomp.lang.javascript&safe=off&qt_s=Search>
but an "info noise" has been added bor "matrix filter" keywords.

And sorry, yes, it was my answer to Message-ID:
<11**********************@f14g2000cwb.googlegroups .com>

Jan 15 '06 #10

P: n/a
JRS: In article <2c*****************@clunker.homenet>, dated Sun, 15
Jan 2006 06:46:18 local, seen in news:comp.lang.javascript, Jasen Betts
<ja***@free.net.nz> posted :
On 2006-01-14, Dr John Stockton <jr*@merlyn.demon.co.uk> wrote:

for (J in document.body.style) document.writeln(J, "<br>")
document.body.style.fontSize = 11

It tells how to do things, for the current browser, with some clue as to
what they may be.

I don't recall how one can read the current settings of those (such as
cursor ).


for (J in document.body.style){
document.writeln(J,"->",document.body.style[J],<br>);
}

same as any other for-in loop


Thanks. I *thought* I'd tried document.body.style[J] ; perhaps I failed
to observe the few non-blank values pos... and textDec... and zIndex.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jan 16 '06 #11

This discussion thread is closed

Replies have been disabled for this discussion.