function switchPreview(direction) {
    var $element = (direction == "next") ? $next : $prev;
    if (!$element) return false;

    var code = makePreview($element.parent()[0]);
    if (!code) return false;
    
    // We're transplanting the contents inside the container, to prevent an animation
    $('#imagePreview').addClass('no-anim').html($(code).children());
    // Add a pulse class, to make the arrow react to a switch
    $('.' + direction, '#imagePreview').addClass('pulse');
  }
// Hotswap the preview for the next or previous
Hotswap the preview for the next or previous
Hotswap the preview for the next or previous
function switchPreview(direction) {
    var $element = (direction == "next") ? $next : $prev;
    if (!$element) return false;
    var code = makePreview($element.parent()[0]);
    if (!code) return false;
    $('#imagePreview').addClass('no-anim').html($(code).children());
    $('.' + direction, '#imagePreview').addClass('pulse');
  }
function switchPreview ( direction ) { var $element = ( direction == "next" ) ? $next : $prev ; if ( ! $element ) return false ; var code = makePreview ( $element . parent ( ) [ 0 ] ) ; if ( ! code ) return false ; $ ( '#imagePreview' ) . addClass ( 'no-anim' ) . html ( $ ( code ) . children ( ) ) ; $ ( '.' + direction , '#imagePreview' ) . addClass ( 'pulse' ) ; }
Hotswap the preview for the next or previous
Hotswap the preview for the next or previous
// We're transplanting the contents inside the container, to prevent an animation // Add a pulse class, to make the arrow react to a switch