js/lightbox.js
function initControls() {
    if (!nextBtn) {
      // create & append next-btn
      nextBtn = document.createElement('span');
      addClass(nextBtn, _const_class_prefix + '-next');
      
      // add custom images
      if (CTX.opt.nextImg) {
        var nextBtnImg = document.createElement('img');
        nextBtnImg.setAttribute('src', CTX.opt.nextImg);
        nextBtn.appendChild(nextBtnImg);
      }
      else {
        addClass(nextBtn, _const_class_prefix + '-no-img');
      }
      addEvent(nextBtn, 'click', function (e) {
        stopPropagation(e); // prevent closing of lightbox
        CTX.next();
      }, false);
      CTX.box.appendChild(nextBtn);
    }
    addClass(nextBtn, _const_class_prefix + '-active');
    if (!prevBtn) {
      // create & append next-btn
      prevBtn = document.createElement('span');
      addClass(prevBtn, _const_class_prefix + '-prev');
      
      // add custom images
      if (CTX.opt.prevImg) {
        var prevBtnImg = document.createElement('img');
        prevBtnImg.setAttribute('src', CTX.opt.prevImg);
        prevBtn.appendChild(prevBtnImg);
      }
      else {
        addClass(prevBtn, _const_class_prefix + '-no-img');
      }
      addEvent(prevBtn, 'click', function (e) {
        stopPropagation(e); // prevent closing of lightbox
        CTX.prev();
      }, false);
      CTX.box.appendChild(prevBtn);
    }
    addClass(prevBtn, _const_class_prefix + '-active');
  }
function initControls() {
    if (!nextBtn) {
      // create & append next-btn
      nextBtn = document.createElement('span');
      addClass(nextBtn, _const_class_prefix + '-next');
      
      // add custom images
      if (CTX.opt.nextImg) {
        var nextBtnImg = document.createElement('img');
        nextBtnImg.setAttribute('src', CTX.opt.nextImg);
        nextBtn.appendChild(nextBtnImg);
      }
      else {
        addClass(nextBtn, _const_class_prefix + '-no-img');
      }
      addEvent(nextBtn, 'click', function (e) {
        stopPropagation(e); // prevent closing of lightbox
        CTX.next();
      }, false);
      CTX.box.appendChild(nextBtn);
    }
    addClass(nextBtn, _const_class_prefix + '-active');
    if (!prevBtn) {
      // create & append next-btn
      prevBtn = document.createElement('span');
      addClass(prevBtn, _const_class_prefix + '-prev');
      
      // add custom images
      if (CTX.opt.prevImg) {
        var prevBtnImg = document.createElement('img');
        prevBtnImg.setAttribute('src', CTX.opt.prevImg);
        prevBtn.appendChild(prevBtnImg);
      }
      else {
        addClass(prevBtn, _const_class_prefix + '-no-img');
      }
      addEvent(prevBtn, 'click', function (e) {
        stopPropagation(e); // prevent closing of lightbox
        CTX.prev();
      }, false);
      CTX.box.appendChild(prevBtn);
    }
    addClass(prevBtn, _const_class_prefix + '-active');
  }
function initControls ( ) { if ( ! nextBtn ) { // create & append next-btn nextBtn = document . createElement ( 'span' ) ; addClass ( nextBtn , _const_class_prefix + '-next' ) ; // add custom images if ( CTX . opt . nextImg ) { var nextBtnImg = document . createElement ( 'img' ) ; nextBtnImg . setAttribute ( 'src' , CTX . opt . nextImg ) ; nextBtn . appendChild ( nextBtnImg ) ; } else { addClass ( nextBtn , _const_class_prefix + '-no-img' ) ; } addEvent ( nextBtn , 'click' , function ( e ) { stopPropagation ( e ) ; // prevent closing of lightbox CTX . next ( ) ; } , false ) ; CTX . box . appendChild ( nextBtn ) ; } addClass ( nextBtn , _const_class_prefix + '-active' ) ; if ( ! prevBtn ) { // create & append next-btn prevBtn = document . createElement ( 'span' ) ; addClass ( prevBtn , _const_class_prefix + '-prev' ) ; // add custom images if ( CTX . opt . prevImg ) { var prevBtnImg = document . createElement ( 'img' ) ; prevBtnImg . setAttribute ( 'src' , CTX . opt . prevImg ) ; prevBtn . appendChild ( prevBtnImg ) ; } else { addClass ( prevBtn , _const_class_prefix + '-no-img' ) ; } addEvent ( prevBtn , 'click' , function ( e ) { stopPropagation ( e ) ; // prevent closing of lightbox CTX . prev ( ) ; } , false ) ; CTX . box . appendChild ( prevBtn ) ; } addClass ( prevBtn , _const_class_prefix + '-active' ) ; }
Initializes the control arrows
Initializes the control arrows