internet explorer - jQuery .width() Conditional Always Triggers in IE -


i have client site switches mobile version whenever viewport size falls within specific paramaters:

if($(window).width() < 800) {     document.location="http://www.website.com/mobile.html"; } 

in various versions of ie, however, script triggers regardless of viewport width. i've tried number of different variations, , can't seem work.

any appreciated.

thanks,

ty

use following code:

if($(window).outerwidth() < 800) {     window.location.href = "http://www.website.com/mobile.html"; } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -