Is there a way to stretch an HTML body?

Z

Zeez

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!
 
E

Evertjan.

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.
 
Z

Zeez

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
 
E

Evertjan.

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.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Fri, 13
Jan 2006 08:33:42 local, seen in Evertjan.
Zeez wrote on 13 jan 2006 in comp.lang.javascript:

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.
 
E

Evertjan.

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>
=============================
 
V

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=bilinear)";

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>
 
E

Evertjan.

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.
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Sun, 15
Jan 2006 06:46:18 local, seen in Jasen Betts
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,171
Latest member
VinayKumar Nevatia__
Top