S
S
Sergey2018-11-01 02:45:09
fancyBox
Sergey, 2018-11-01 02:45:09

Resizing fancybox. How?

There is a code:

$("li a").fancybox({
    minWidth: 900
  });

The image size is set to 900 px how to make the image size on the screen less than 900 px be 400px and on the phone 200px?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly Pershin, 2018-11-01
@deepprod

Use 100% width and max:

width: '100%',
maxWidth: 900

Above 900 your window will always be 900, and below 900 it will shrink to take up 100% of the screen width

N
Nikolai Chuprik, 2018-11-01
@choupa

I am using device.js library

var fancy = { minWidth: 900 };    // дефолт

if ( $( document ).width < 900 ) fancy.minWidth = 400;
if ( device.mobile() ) fancy.minWidth = 200;    //  использована device.js

$( "li a" ).fancybox( fancy );

B
BitRouter, 2018-11-01
@BitRouter

And what for it is fixed to specify width?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question