Getting the screen resolution from the command line.
Johnneylee Rollins
johnneylee.rollins at gmail.com
Wed Mar 3 09:43:25 UTC 2010
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 at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
More information about the ubuntu-users
mailing list