Skip to content

Commit

Permalink
悄悄的更新一下获取设备宽度的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
imochen committed Feb 17, 2016
1 parent b9261e7 commit b869d65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example/hotcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
}

hotcss.mresize = function(){
//对,这个就是核心方法了,给HTML设置font-size,三行足矣
var innerWidth = window.innerWidth;
//对,这个就是核心方法了,给HTML设置font-size。
var innerWidth = document.documentElement.getBoundingClientRect().width || window.innerWidth;

if( hotcss.maxWidth && (innerWidth/hotcss.dpr > hotcss.maxWidth) ){
innerWidth = hotcss.maxWidth*hotcss.dpr;
Expand Down
4 changes: 2 additions & 2 deletions src/hotcss.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
}

hotcss.mresize = function(){
//对,这个就是核心方法了,给HTML设置font-size,三行足矣
var innerWidth = window.innerWidth;
//对,这个就是核心方法了,给HTML设置font-size。
var innerWidth = document.documentElement.getBoundingClientRect().width || window.innerWidth;

if( hotcss.maxWidth && (innerWidth/hotcss.dpr > hotcss.maxWidth) ){
innerWidth = hotcss.maxWidth*hotcss.dpr;
Expand Down

0 comments on commit b869d65

Please sign in to comment.