Hello,
I have a mobile website that detect the user's device screen width and height, and based on these dimensions I have to redirect the user to the best images folder that has the same or very close size to the user's device. There is no problem if I have images with the same exact size as the device, but the problem appears when I don't have similar size within my images, so I have to search for the most close size that fits with the user's device. How can I achieve this search and selection with jquery? Like if the user device screen size is 300 X 380 and as you can see I don't have it ready in below sizes, so I must forward it to 320X480.
240x320
320x480
360x480
480x800
640x960
960x800
960x854
Thank in advance.