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


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 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.


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 6 Years 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 6 Years ago Karma: 760
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 6 Years ago Karma: 0
Thank you so much! Works great!
The administrator has disabled public write access.
 
Go to topPage: 1