$(document).ready(function() { $('#gallery img').fancyZoom({closeOnClick: true, directory:'lib/fancy-zoom/img/'}); });