How to disable navigation arrows when in mobile? #828
-
|
I've just started using fancybox and been trying to learn the ins and outs. In the fancyapps guide there is code for the dynamic pages for instances of carousel: Fancybox.bind("[data-fancybox]", { However it looks like I can only add Arrows: false, under the carousel and not the toolbar. Is there a way that arrows can be disabled in the first instance (mobile / small screens) and still work in the desktop versions? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi, Sorry, I didn't understand your comment, but you simply set Fancybox.bind('[data-fancybox]', {
Carousel: {
Arrows: false,
Toolbar: {
display: {
left: ['counter'],
middle: [],
right: ['thumbs', 'close'],
},
},
breakpoints: {
'(min-width: 768px)': {
Arrows: true,
Toolbar: {
display: {
left: ['counter'],
middle: [
'zoomIn',
'zoomOut',
'toggle1to1',
'rotateCCW',
'rotateCW',
'flipX',
'flipY',
],
right: ['autoplay', 'thumbs', 'close'],
},
},
},
},
},
}) |
Beta Was this translation helpful? Give feedback.
-
|
Hi, Thanks for your help! I was able to get the code up and running. I think my problem was that I used Carousel: { } twice, once in the initial script and once again in the mid-width code. I'm guessing using it twice doesn't work or isn't allowed. Either that or I used one too many or little { } pairings. In any case thank you again! Fancybox.bind("[data-fancybox]", { Carousel: { breakpoints: { }, |
Beta Was this translation helpful? Give feedback.
Hi,
Sorry, I didn't understand your comment, but you simply set
Arrows: truewhen arrows are needed andArrows:falsewhen they are not needed: