1

I am using Featherlight version 1.5.0 in my design. I can disable the right-click on the thumbnail images with this snippet of JavaScript:

<script type="text/javascript">
  $('img').bind('contextmenu', function(e) {
    return false;
  }); 
</script>

But this doesn't work with link images, which pops up when the thumbnail is clicked. Is there anyway that right-click can be disabled on the link images?

Richie
  • 379
  • 1
  • 4
  • 15
  • 3
    why would you disable right click?i doubt it is user friendly.. read on [this](http://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page) – guradio Jan 03 '17 at 06:02

1 Answers1

0

$('img').bind('contextmenu', function(e) {
    return false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h3>Gallery</h3>
<div data-featherlight-gallery data-featherlight-filter="a">
  <a href="http://farm8.staticflickr.com/7070/6874560581_dc2b407cc0_b.jpg"><img src="http://farm8.staticflickr.com/7070/6874560581_dc2b407cc0_q.jpg" /></a>
  <a href="http://farm5.staticflickr.com/4005/4400559493_3403152632_o.jpg"><img src="http://farm5.staticflickr.com/4005/4400559493_f652202d1b_q.jpg" /></a>
  <a href="http://farm1.staticflickr.com/174/396673914_be9d1312b1_o.jpg"><img src="http://farm1.staticflickr.com/174/396673914_be9d1312b1_q.jpg" /></a>
</div>

Would you please check above snippet? It's working fine with your code.

Purvik Dhorajiya
  • 4,662
  • 3
  • 34
  • 43