| | |||||
| ||||||||
| CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Suspended Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() | Javascript code for resolution (you need to edit it) This is how im using it, im using 2 div's with the ids of header and content. Just showing you this code, because many people ask for this type of thing so here it is ![]() ????: NamePros.com http://www.namepros.com/code/47105-javascript-code-resolution-you-need-edit.html Code: <script language="Javascript"><!--
var header = document.getElementById("header");
var content = document.getElementById("content");
if ((screen.width == 800) && (screen.height == 600)) {
var leftsize = "40";
header.style.left = leftsize;
content.style.left = leftsize;
}
if ((screen.width == 1024) && (screen.height == 768)) {
var leftsize = "150";
header.style.left = leftsize;
content.style.left = leftsize;
}
if ((screen.width == 1152) && (screen.height == 864)) {
var leftsize = "200";
header.style.left = leftsize;
content.style.left = leftsize;
}
if ((screen.width == 1280) && (screen.height == 1024)) {
var leftsize = "275";
header.style.left = leftsize;
content.style.left = leftsize;
}
if ((screen.width == 1600) && (screen.height == 1200)) {
var leftsize = "450";
header.style.left = leftsize;
content.style.left = leftsize;
}
//--></script> |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Sep 2004 Location: Poland
Posts: 245
![]() | This script works only with certain fixed resolutions. For example, in my work I have 1024x1280 (yes, it's 1280x1024 rotated 90 degrees - VERY useful for viewing long pages and documents!). Your script will not know what to do with this resolution. You should make it more general.
__________________ Dropcatcher.de - .de domain dropcatching! |
| |
| | THREAD STARTER #3 (permalink) | ||||
| Account Suspended Join Date: May 2004 Location: /etc/passwd
Posts: 2,178
![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=47105 Thats why it says, you will need to edit it. | ||||
| |