weixin_39700220
weixin_39700220
2020-12-09 12:58

Toggle functionality

It is great to have all the different slideshow options (zoom, thumbnails, etc.). However, for a more minimal version I would love to be able to toggle each option on and off / setting each to true or false. For some elements I can do a workaround by customizing the CSS, for example setting toolbar elements to display: none. But in particular I would like to switch off the zoom functionality when clicking on an enlarged image. Is there a way to do this right now? Otherwise I would find it a very useful enhancement to have several toggle options.

该提问来源于开源项目:lucaspulliese/vue-cool-lightbox

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

10条回答

  • weixin_39833454 weixin_39833454 5月前

    Hi again :D

    I don't understand what you want, could you give me an example?

    点赞 评论 复制链接分享
  • weixin_39700220 weixin_39700220 5月前

    Sorry for being unclear :)

    I would like to be able to toggle the functional elements inside the lightbox individually to better adapt the lightbox to my design and desired functionality. Just like the Fullscreen option that can already be toggled, and I just realized that I can already toggle the thumbnail option with :gallery="false". But it would be great if all elements could have this option, something to the effect of:

    :play="false" (disable Play icon) :close="false" (disable Close icon) :toolbar="false" (disable entire toolbar) :zoom="false" (disable zoom on click)

    Only for the arrows this wouldn't make sense.

    In my current case, I don't need the toolbar at all, it is sufficient for me to close the gallery with a click outside of the image. And I don't want users to be able to zoom when clicking on the image.

    Hope this is more understandable. Thanks again for this great tool :)

    点赞 评论 复制链接分享
  • weixin_39833454 weixin_39833454 5月前

    It's ok my friend!

    Ok, I understand your point now.

    Sure, I will be working on it :)

    点赞 评论 复制链接分享
  • weixin_39700220 weixin_39700220 5月前

    Awesome, thanks a lot!

    点赞 评论 复制链接分享
  • weixin_39833454 weixin_39833454 5月前

    Hi again, sorry, It has been a long time since this enhancement has been uploaded.

    Now in version 2.4.0 you can hide all of the buttons from the toolbar with something like this:

    javascript
    <coollightbox :items="items" :index="index" :slideshow="false" :gallery="false" :showclosebutton="false" null></coollightbox>
    

    Slideshow will hide the play/pause button, gallery will hide the open gallery button and showCloseButton will hide close button.

    点赞 评论 复制链接分享
  • weixin_39700220 weixin_39700220 5月前

    Amazing, thanks a lot!

    点赞 评论 复制链接分享
  • weixin_39700220 weixin_39700220 5月前

    Sorry, I just realized that one of my requests isn't covered. One of the most important things for me is to be able to disable the zoom when clicking on the image. Did you decide against implementing this option?

    点赞 评论 复制链接分享
  • weixin_39833454 weixin_39833454 5月前

    You are right, I forgot that request, I'm sorry, I will be working on it.

    点赞 评论 复制链接分享
  • weixin_39833454 weixin_39833454 5月前

    Hi again, update your lightbox to 2.4.1, there's a prop called disableZoom, that will disable zoom on all images.

    点赞 评论 复制链接分享
  • weixin_39700220 weixin_39700220 5月前

    So quick! Thank you :)

    点赞 评论 复制链接分享

相关推荐