Code:
- <script type="text/javascript">
- function Size(SType)
- var TypeSize;
- switch (SType){
- case x:
- if (window.innerWidth){
- TypeSize = window.innerWidth
- } else if (document.all){
- TypeSize = document.body.clientWidth
- }
- break;
- case y:
- if (window.innerWidth){
- TypeSize = window.innerHeight
- } else if (document.all){
- TypeSize = document.body.clientHeight
- }
- break;
- default:
- break;
- }
- return TypeSize;
- }
- </script>
How would I use this for a table for width and height and would this code work?
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![]()
The code uses the height and width of the client's window
ok and if i recall width and height with percentage checks the users res.
It doesn't really work out that way
document.write(Size(x));
or
document.write(Size(y));
![]()
Thanks