Re: Getting the screen resolution from the command line.



If you're not adverse to javascript, here is what you want if you want
the size of the browser.

<script type="text/javascript">
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && (
document.documentElement.clientWidth ||
document.documentElement.clientHeight ) ) {
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth ||
document.body.clientHeight ) ) {
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
document.write( myWidth + "x" + myHeight );
</script>


Or this for the size of the screen it's on.

<script type="text/javascript">
document.write(screen.width+'x'+screen.height);
</script>

Or CSS to center it
<style type="text/css">
div#center {
margin:0 auto 0 auto;
}
</style>

~SpaceGhost

--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: A Strange c# - vb Difference
    ... In C# the meaning of the / operator is decided by the data types of the operands. ... myAspectRatio = myWidth / myHeight ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help with Automatic Height Script
    ... Maybe it's an onResize event that doesn't ... but in any other standards compliant browser it does ... myWidth = document.documentElement.clientWidth; ... myHeight = document.documentElement.clientHeight; ...
    (comp.lang.javascript)
  • Re: A Strange c# - vb Difference
    ... myAspectRatio = (float) myWidth / myHeight; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Strange c# - vb Difference
    ... myAspectRatio = myWidth / myHeight; ... Why does the C# code produce the incorrect answer of 0.0? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Strange c# - vb Difference
    ... Specify type implicitly like myAspectRatio = myWidth / myHeight; ... T> Dim myHeight As Integer = 1600 ...
    (microsoft.public.dotnet.languages.csharp)