Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Limit maximum image size on iPad
(1 viewing) (1) Guest
"ARI Fancy Lightbox" WordPress plugin
Go to bottomPage: 1
TOPIC: Limit maximum image size on iPad
#64175
Limit maximum image size on iPad 5 Years, 5 Months ago Karma: 0
I've got the lightbox working great on desktop monitors where my images display at 1:1 pixel ratio.

However, on the iPad the images are enlarged to fill the screen. This can make the images look a little blurry on the sharp retina screen.

Is there a way to limit the maximum height and width of the images on the iPad (e.g. so they fill about 75% of the screen maximum)?

Thank you.
The administrator has disabled public write access.
 
#64187
Re:Limit maximum image size on iPad 5 Years, 5 Months ago Karma: 748
Hello,

Try the following solution: open "ARI Fancy Lightbox -> Settings -> Advanced" page and populate "Custom JS code" parameter with the following code:

Code:


$.fancybox.defaults.afterLoad = function(instance, current) {
        if (current.type !== 'image') return ;

        var pixelRatio = window.devicePixelRatio || 1;

        if ( pixelRatio > 1.5 ) {
            current.width  = current.width  / pixelRatio;
            current.height = current.height / pixelRatio;
        }
}



Regards,
ARI Soft
The administrator has disabled public write access.
 
#64192
Re:Limit maximum image size on iPad 5 Years, 5 Months ago Karma: 0
Thank you so much! Works great!
The administrator has disabled public write access.
 
Go to topPage: 1