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?
Asked
Active
Viewed 1,416 times
0

Subhan Asadli
- 330
- 2
- 17
-
Which code? Please write more context of your problem – Michi May 24 '19 at 08:55
-
Should I add the entire code of the PhotoSwipe library here ? – Subhan Asadli May 24 '19 at 09:00
1 Answers
1
Well I would just disable it through the options listed in the documentation: https://photoswipe.com/documentation/options.html
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
-
Yes I was looking for the first solution. I've just somehow overseen that options object can be used for it. Thanks! – Subhan Asadli May 24 '19 at 09:10