gestures.js 771 B

12345678910111213141516171819202122
  1. function clickGestures(item) {
  2. let openItem = document.getElementById('item-'+item);
  3. openItem.addEventListener('click', function(e) {
  4. if (document.getElementById('modal-'+this.id).style.display === '') {
  5. document.getElementById('modal-'+this.id).style.display = 'none';
  6. return;
  7. }
  8. document.getElementById('modal-'+this.id).style.display = '';
  9. });
  10. let closeItem = document.getElementById('close-'+item);
  11. closeItem.addEventListener('click', function(e) {
  12. let ritem = this.id.replace('close','item');
  13. if (document.getElementById('modal-'+ritem).style.display === '') {
  14. document.getElementById('modal-'+ritem).style.display = 'none';
  15. return;
  16. }
  17. document.getElementById('modal-'+ritem).style.display = '';
  18. });
  19. }