Javascript Detect Screen Resolution, change css, crop images accordingly
问题 So I know how to change the css depending on the resolution via javascript. How would one go about 'cropping' an image depending on the screen resolution? 回答1: Well you can get the screen details from window.screen - though personally I would recommend just finding out how big the current window is, the only reason not to is if you are going to resize the window and that is very frowned upon. Once you know the sizes and how big you need to make your images, I find that images are cropped