GetHeight() Function


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function GetHeight() {
  2. var y = 0;
  3. if (self.innerHeight) {
  4. y = self.innerHeight;
  5. }
  6. else if (document.documentElement && document.documentElement.clientHeight) {
  7. y = document.documentElement.clientHeight;
  8. }
  9. else if (document.body) {
  10. y = document.body.clientHeight;
  11. }
  12. return y;
  13. }
  14.  
  15. whe = GetHeight();
  16. if (whe < 550) {
  17. ahe = 150;
  18. } else {
  19. ahe = 300;
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.