I don't usually do javascript but I wrote this little bit of code to help me when adapting themes to work on different resolution monitors. I bet Fire Fox already has some tool like this, but I use Chrome most of the time.
All I do is have this page open in one of the tabs and it shows me the current browser dimensions. So I can easily see what's going on without the hassle of changing my display settings. I guess you could also temporarily put the code into a TP block if you wanted too.
Here's the code, just save it as HTML and open it up, maybe this will be useful to someone.
Oh guess what...it doesn't work in IE LOL, I'll drop in an IE version at some point.
<html>
<head>
<script type="text/javascript">
function showSizes() {
document.dimensions.dis.value = 'Outer Width = ' + window.outerWidth + '\r\n';
document.dimensions.dis.value += 'Outer Height = ' + window.outerHeight + '\r\n';
document.dimensions.dis.value += 'Inner Width = ' + window.innerWidth + '\r\n';
document.dimensions.dis.value += 'Inner Height = ' + window.innerHeight;
}
</script>
</head>
<body onresize="showSizes();" onload="showSizes();">
<form name="dimensions">
<textarea style="width:200; height:200" name="dis"></textarea>
</form>
</body>
</html>
Does this not show the width/height for the current tab it is in and not the other tab(s)??
well I use chrome and sometimes FF, so all tabs in the same window will be the same size. So if you just have one tab with the tool open, it will let you know the size of the one you are working on too - because it will be the same size.
You can have separate windows sure, but this will only show the sizes of the tabs in the window it is opened in.
Is that what you mean and did I make any sense LOL ?
If your purpose is to test sites your working on, an easy way to do it is add a bookmark, instead of an url put this:
javascript:resizeTo(1024,768)
Add several bookmarks at different sizes..
Nice idea, yes I have tried that, the thing is, as far as I know it only works with IE. But it's useful none-the-less. 8)
I'm using Firefox, never tried it with any other browser. :o
edit: just tried: in Opera it does not work, but it does in Safari and IE.