function viewport() {
var e = window, a = 'inner';
if (!('innerWidth' in window)) {
a = 'client';
e = document.documentElement || document.body;
}
return { width: e[a + 'Width'], height: e[a + 'Height'] };
}
viewport().width
JQuery window width not correct in Chrome
In some cases, $(window).width() doesnt return correct width of window, maybe because of scroll bar. So one of solution work for me i:
An Nguyen
DeveloperSharing daily exciting lesson learned and posts about .NET, SQL Server, HTML, Javascript - jQuery, CSS - Bootstrap, SalesForce CRM, Kentico CMS and so on.
0 comments :
Post a Comment