Comments (3)
This would probably be better actually:
if( typeof( window.innerWidth ) != 'number' ) {
if (!(document.documentElement.clientWidth === 0)) {
// strict mode
w = document.documentElement.clientWidth;
} else {
// quirks mode
w = document.body.clientWidth;
}
} else {
// w3c
w = window.innerWidth;
}
return w;
};
from jrespond.
@hershmire I had not tested the script with iframes -- nice catch! I'm finding that window width is a tricky thing to nail down across browsers. Feel free to go ahead with a PR and I'll check it out. Thanks!
from jrespond.
@ten1seven Just issued a pull request for ya on this: #11
from jrespond.
Related Issues (16)
- document.documentElement.clientWidth vs window.innerWidth HOT 5
- Function doesn't load at breakpoint only when entering breakpoint HOT 2
- Add change function for breakpoints.
- Bower HOT 8
- jRespond and Firefox select menu
- Debugging with firebug almost impossible
- publish to npmjs respository HOT 3
- Add Version HOT 2
- Addition to remove function HOT 2
- compare to cssobj HOT 1
- jRespond and Blendid HOT 4
- which cases that document.body.clientWidth equal document.documentElement.clientWidth HOT 1
- What would be the best way to load a jQuery plugin in a enter:function()? HOT 1
- function is not triggered when page load.
- Overlapping breakpoints HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrespond.