简体   繁体   中英

Make fancybox (jquery) use server-side (php) resizing for images

Is there a way for fancybox (jquery) to use serverside resizing (preferably php) instead of just using client resizing ? Anyone tried doing this ?

The problem with this approach is that the server-side scripts (PHP in this case) have finished running once the page has been sent to the visitor's browser (client). Client-side resizing techniques are used because the client-side scripts (jQuery in this case) have access to the client browser and can base their sizing off of environment variables such as the browser's viewport size.

Bottomline: While you can pre -size on the server side, perhaps serving up a range of image sizes, or including some viewport/sizing info in the request, but no server-side technique will be able to match the level of control you'll have on the client side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM