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
Post a Comment