There is a website on wordpress and a NextGEN Gallery gallery plugin. I want to make sure that 4 photos are displayed from the gallery, and the rest are hidden in the spoiler, and by clicking on the check mark the list is expanded? Can this be done using this gallery or need another?

  • This can be done using javascript, no matter what gallery to use - Umer
  • @Umer is logical. Do you know how to do this? - Vasya
  • Give a link to the site - Umer
  • @Umer here, please - a-lot-of-money.ru/templates/30/gallery - Vasya

1 answer 1

This should be done after the gallery is loaded, if onload does not work.

 window.addEventListener("load", function() { var height = $('.slideshowlink').height() + $('#ngg-image-0').height() * 2; var button = $('<button></button>'); var gallery = $('.ngg-galleryoverview') button.html('Показать все').attr('type', 'button').css({ position: 'absolute', top: 0, right: 0 }); button.prependTo(gallery); gallery.height(height); button.on('click', function() { gallery.css('height', 'auto') }); }) 

  • Yes, onload did not work - but how to track the loading of the gallery? - Vasya