vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Window height/width code - View Topic
Topic Rating: *****
Printable View
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Window height/width code (7th Jan 10 at 6:14pm UTC)
Code:
 
  1. <script type="text/javascript">
  2.  
  3.     function Size(SType)
  4.  
  5.         var TypeSize;
  6.  
  7.         switch (SType){
  8.     
  9.             case x:
  10.     
  11.                 if (window.innerWidth){
  12.                     TypeSize = window.innerWidth
  13.                 } else if (document.all){
  14.                     TypeSize = document.body.clientWidth
  15.                 }
  16.  
  17.                 break;
  18.  
  19.             case y:
  20.     
  21.                 if (window.innerWidth){
  22.                     TypeSize = window.innerHeight
  23.                 } else if (document.all){
  24.                     TypeSize = document.body.clientHeight
  25.                 }
  26.  
  27.                 break;
  28.  
  29.             default:
  30.  
  31.                 break;
  32.  
  33.         }
  34.  
  35.         return TypeSize;
  36.  
  37.     }
  38.  
  39. </script>
 


How would I use this for a table for width and height and would this code work?

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
dog199200
Guest
Re: Window height/width code (7th Jan 10 at 8:07pm UTC)
not sure about the code but wouldn't it just be easier using percentage in the height and width area instead of using a JS code {Unsure}
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Window height/width code (7th Jan 10 at 8:24pm UTC)
The code uses the height and width of the client's window

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
dog199200
Guest
Re: Window height/width code (7th Jan 10 at 8:35pm UTC)
ok and if i recall width and height with percentage checks the users res.
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Window height/width code (7th Jan 10 at 10:11pm UTC)
It doesn't really work out that way

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Window height/width code (8th Jan 10 at 12:37am UTC)
document.write(Size(x));
or
document.write(Size(y));

{Smile}
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 35
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Window height/width code (8th Jan 10 at 1:38am UTC)
Thanks

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
 Printable View

All times are GMT+0 :: The current time is 4:30am
Page generated in 0.5095 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums