|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Layer element moved when show in another resolution screen
my question is : can javascript get the screen resolution which user use to see my site ? i want get it to set x (or y) paramater of layer element for right display.
Beccause when i set x,y parameter of Layer,my screen resolution is 1024 - 728, then i reset my screen resolution to 800 - 600, my layer move to horizontal ! Sorry, my english not good. |
|
#2
|
|||
|
|||
|
.........
|
|
#3
|
|||
|
|||
|
My question seen un-feasible, so anyone tell me another way to prevent Layer element move on another screen resolution ?
![]() |
|
#4
|
|||
|
|||
|
Read this: The importance of window-width
|
|
#5
|
|||
|
|||
|
Quote:
thank you very much,but...oh my god ! i tried to read it, but it's very hard to understand because my Eng not good. and i can't see any method,code,command or function to sold my problem. maybe i miss it. Please help me ! Can you re-write summary it and easy to understand, clearly to do. |
|
#6
|
|||
|
|||
|
Sorry, I'll try to explain what the article said in simpler terms: screen resolution doesn't matter; it's the width of the browser window that matters. Does that make sense to you?
Try this code from this page. Code:
var x,y;
if (self.innerHeight) // all except Explorer
{
x = self.innerWidth;
y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
// Explorer 6 Strict Mode
{
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
x = document.body.clientWidth;
y = document.body.clientHeight;
}
|
|
#7
|
||||
|
||||
|
I Had The Same Problem
But I have an answer...
var sw=screen.width; //total screen width resolution var sh=screen.height; //total screen height resolution var ww=0; //total window width var wh=0; //total window height if (window.innerWidth == null) { ww = document.body.clientWidth; wh=document.body.clientHeight; } else { ww = window.innerWidth; wh = window.innerHeight; } // also to pretty much Maximize your browser use this... parent.moveTo(0,0); parent.resizeTo(screen.availWidth,screen.availHeig ht); if you need anymore help, please email me at colton22@comcast.net colton22 -- http://www.freewebs.com/colton22 si hablas espanol... yo hablo espanol no muy bien, pero asi. var sw=screen.width; //total screen width resolution var sh=screen.height; //total screen height resolution var ww=0; //total window width var wh=0; //total window height if (window.innerWidth == null) { ww = document.body.clientWidth; wh=document.body.clientHeight; } else { ww = window.innerWidth; wh = window.innerHeight; } // a Maximize tu browser usa... parent.moveTo(0,0); parent.resizeTo(screen.availWidth,screen.availHeig ht); si nessistas mas, mandar un email a colton22@comcast.net colton22 -- http://www.freewebs.com/colton22 |
|
#8
|
|||
|
|||
|
thank you
thank Kravvitz and colton22. you have whole-hearted help for me. i will try both.
![]() |
|
#9
|
||||
|
||||
|
no problem, and i do have one question,
hablas espanol?? - do you speak spanish? colton22 |
|
#10
|
||||
|
||||
|
hablo
[OT]Yo hablo un muy poco, pero no comprendo nada[/OT]
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Layer element moved when show in another resolution screen |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|