function makePreview(element) {
    if (!element) return false;

    // Previous and next elements get tracked in the JS enclosure
    $prev = $('img', $(element).prev('.zoom'));
    $next = $('img', $(element).next('.zoom'));
    
    // Grab the description
    var desc = $('img', element).attr('alt');
    // Format next/previous links when they're relevant
    var prev = $prev.length ? '<a href="#" data-direction="prev" class="screenshot-prev prev"><img alt="previous" src="images/site/arrow-left.svg"></a>' : '';
    var next = $next.length ? '<a href="#" data-direction="next" class="screenshot-next next"><img alt="next" src="images/site/arrow-right.svg"></a>' : '';

    // Generate jQuery document fragment based on the generated HTML
    var $html = $('<div id="imagePreview" class="image-container zoom-out">' + prev + '<img src="' + element.href + '" alt="' + desc + '">' + next + '<p>' + desc + "</p></div>");
    
    return $html;
  }
// Generate the HTML for the zoomed in preview
Generate the HTML for the zoomed in preview
Generate the HTML for the zoomed in preview
function makePreview(element) {
    if (!element) return false;
    $prev = $('img', $(element).prev('.zoom'));
    $next = $('img', $(element).next('.zoom'));
    var desc = $('img', element).attr('alt');
    var prev = $prev.length ? '<a href="#" data-direction="prev" class="screenshot-prev prev"><img alt="previous" src="images/site/arrow-left.svg"></a>' : '';
    var next = $next.length ? '<a href="#" data-direction="next" class="screenshot-next next"><img alt="next" src="images/site/arrow-right.svg"></a>' : '';
    var $html = $('<div id="imagePreview" class="image-container zoom-out">' + prev + '<img src="' + element.href + '" alt="' + desc + '">' + next + '<p>' + desc + "</p></div>");
    return $html;
  }
function makePreview ( element ) { if ( ! element ) return false ; $prev = $ ( 'img' , $ ( element ) . prev ( '.zoom' ) ) ; $next = $ ( 'img' , $ ( element ) . next ( '.zoom' ) ) ; var desc = $ ( 'img' , element ) . attr ( 'alt' ) ; var prev = $prev . length ? '<a href="#" data-direction="prev" class="screenshot-prev prev"><img alt="previous" src="images/site/arrow-left.svg"></a>' : '' ; var next = $next . length ? '<a href="#" data-direction="next" class="screenshot-next next"><img alt="next" src="images/site/arrow-right.svg"></a>' : '' ; var $html = $ ( '<div id="imagePreview" class="image-container zoom-out">' + prev + '<img src="' + element . href + '" alt="' + desc + '">' + next + '<p>' + desc + "</p></div>" ) ; return $html ; }
Generate the HTML for the zoomed in preview
Generate the HTML for the zoomed in preview
// Previous and next elements get tracked in the JS enclosure // Grab the description // Format next/previous links when they're relevant // Generate jQuery document fragment based on the generated HTML