һ
 ¼ע

QQ¼

ֻһٿʼ

̳ WEBҳǰ뿪 ǰ̨ű

JS ȡҳݸ߶ ҳӸ߶ ֧IE 6789 Firefox Chrome

[]
83633 websjy 2011-2-25 09:50:26
| ʾȫ¥
1F

ϵ½עᣬύѣø๦ܣϴزIJޣ

Ҫ ¼ ſػ鿴ûʺţ¼ע  

x
  1. function getClientHeight()
  2. {
  3. //ɼ
  4. var clientHeight=document.body.clientHeight;//Ĭֵ
  5. if(navigator.userAgent.indexOf("MSIE 6.0")!=-1)
  6. {
  7. clientHeight=document.body.clientHeight;
  8. }
  9. else if(navigator.userAgent.indexOf("MSIE")!=-1)
  10. {
  11. //IE7 IE8
  12. clientHeight=document.documentElement.offsetHeight
  13. }

  14. if(navigator.userAgent.indexOf("Chrome")!=-1)
  15. {
  16. clientHeight=document.body.scrollHeight;
  17. }

  18. if(navigator.userAgent.indexOf("Firefox")!=-1)
  19. {
  20. clientHeight=document.documentElement.scrollHeight;
  21. }
  22. return clientHeight;
  23. }

  24. //ҳݸ߶
  25. function getContentHeight()
  26. {
  27. //ɼ
  28. var ContentHeight=document.body.scrollHeight;//Ĭֵ

  29. if(navigator.userAgent.indexOf("Chrome")!=-1)
  30. {
  31. ContentHeight= document.body.clientHeight;
  32. }

  33. if(navigator.userAgent.indexOf("Firefox")!=-1)
  34. {
  35. ContentHeight=document.body.offsetHeight;
  36. }
  37. return ContentHeight;
  38. }
ƴ
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ
lwnykf 2011-2-25 15:29:34
| ʾȫ¥
2F

ѧУ
֣칫˾
Դ΢http://weibo.com/techued Դ΢Źںţweb-tech
ʹõ ٱ ظ ֧
б

ֹ

̳¡ͼƬѷϴվԭתԻ,µİȨԭ
վַİȨ֪ͨǵĹԱ,Ա(Email:admin@websjy.com)ʱȡȨɾ
ܾκκʽڱ̳л񹲺͹ִ!

QQ| 42011102000510|Archiver|ֻ|Դ ( ICP14013341-1

GMT+8, 2019-5-26 18:09

Powered by Discuz! X3.2

ԴԴվ  ԴAPPӦ֮

ٻظ ض б