0

I'm disabling the share button from inside of photoswipe-ui-default.js file right now. However I'm wondering whether there is a posibility to do it from outside of that code?

Subhan Asadli
  • 330
  • 2
  • 17

1 Answers1

1

Well I would just disable it through the options listed in the documentation: https://photoswipe.com/documentation/options.html

Image of documentation

Otherwise you could do the following:

<script>
var divsToHide = document.getElementsByClassName("pswp__button pswp__button--share"); //divsToHide is an array
for(var i = 0; i < divsToHide.length; i++){
    divsToHide[i].style.visibility = "hidden"; // or
    divsToHide[i].style.display = "none"; // depending on what you're doing
}
</script>

Taken from: Hide all elements with class using plain Javascript

Webbanditten
  • 850
  • 9
  • 21