Is it possible, using JQuery, to redirect to a different index.html based upon the users screen resolution? So for example, screens upto the size 1024px wide go to 1024.html, and all others go to the normal index.html?
Id preferably like to use jQuery for this. Any help would be greatly appreciated!
Thanks!
You don't need jQuery.
You can use screen.width, which works in all browsers:
if (screen.width <= 1024) window.location.replace("http://www.example.com/1024.html")
else window.location.replace("http://www.example.com/index.html")
See http://www.dynamicdrive.com/dynamicindex9/info3.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With