anchor.diff:             contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (data) {
  +             content = content.concat(data.entities);
  +               var gallery = $('#gallery');
  +               var carousel = $('#carousel');
                   for(var i = 0; i < data.entities.length - 1; i++){
  -                    $('#gallery').append('<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 mbr-gallery-item"><a href="#lb-gallery1-2" data-slide-to="'+i+'" data-toggle="modal"> <img alt="" src="'+data.entities[i].src+'"><span class="icon glyphicon glyphicon-zoom-in"></span></a></div>');
  -//                    $('#carousel-indicators').append('<li data-app-prevent-settings="" data-target="#lb-gallery1-2" data-slide-to="'+i+'"></li>');
  -                    $('#carousel').append('<div class="item"><div ></div><img alt="" src="'+data.entities[i].src+'"></div>');
  +                    gallery.append('<div name="' + i + '" class="col-lg-3 col-md-4 col-sm-6 col-xs-12 mbr-gallery-item"><a href="#lb-gallery1-2" data-slide-to="' + i + '" data-toggle="modal"> <img alt="" src="' + data.entities[i].src + '"><span class="icon glyphicon glyphicon-zoom-in"></span></a></div>');
  +                    carousel.append('<div id=' + i + ' class="item"><div></div><img alt="" src="' + data.entities[i].src + '"></div>');
                   }
  -               $('#gallery').append('<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 mbr-gallery-item"><a href="#lb-gallery1-2" data-slide-to="'+(data.entities.length - 1)+'" data-toggle="modal"> <img alt="" src="'+data.entities[data.entities.length - 1].src+'"><span class="icon glyphicon glyphicon-zoom-in"></span></a></div>');
  -//               $('#carousel-indicators').append('<li class="active" data-app-prevent-settings="" data-target="#lb-gallery1-2" data-slide-to="'+i+'"></li>');
  -               $('#carousel').append('<div class="item active"><img alt="" src="'+data.entities[data.entities.length - 1].src+'"></div>');
  +               gallery.append('<div name="' + (data.entities.length - 1) + '" class="col-lg-3 col-md-4 col-sm-6 col-xs-12 mbr-gallery-item"><a href="#lb-gallery1-2" data-slide-to="' + (data.entities.length - 1) + '" data-toggle="modal"> <img alt="" src="' + data.entities[data.entities.length - 1].src + '"><span class="icon glyphicon glyphicon-zoom-in"></span></a></div>');
  +               carousel.append('<div id=' + i + ' class="item active"><img alt="" src="' + data.entities[data.entities.length - 1].src + '"></div>');
  +
  +               $('.carousel-control, .mbr-gallery-item').click(function () {
  +                   setTimeout(function () {
  +                       var activeId = $('.active').attr('id');
  +                       var item = data.entities[activeId];
  +                       var rightInfo = $('#right-info').html("");
  +                       var sku = '<div style="margin-top: -500px; margin-left: 650px"><div style="color: #ffffff"><h2>Артикул:' + item.sku + '</h2></div>';
  +                       var length = '<div style="color: #ffffff"><h2>Длинна:' + item.length + '</h2></div>';
  +                       var width = '<div style="color: #ffffff"><h2>Ширина:' + item.width + '</h2></div>';
  +                       var pricePerMeter = '<div style="color: #ffffff"><h2>Цена за метр: ' + item.pricePerMeter + '</h3></div>';
  +                       var totalPrice = '<div style="color: #ffffff"><h2>Общая цена: ' + item.totalPrice + '</h2></div>';
  +                       var button = '<button onclick="onAddClick(' + activeId + ')"  type="button" data-dismiss="modal" class="btn btn-danger">В корзину</button></div>';
  +                       rightInfo.append(sku + length + width + pricePerMeter + totalPrice + button)
  +                   }, 750);
  +               });
              }
          });
      });
  +
  +    var onAddClick = function (activeId) {
  +        alert("Ткань с id: " + activeId + " добавлена в корзину");
  +        content.splice(activeId,1);
  +        alert(content.length);
  +        $('#' + activeId).detach();
  +        $('div[name='+activeId+']').detach();
  +        $('#' + content.length-1).addClass("active");
  +    }
  +
   </script>
   
   </html>
positive.code:                         <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
                          <span class="sr-only">Close</span>
                      </a>
                  </div>
              </div>
          </div>
      </div>
  </section>
  
negative.code:                 <div class="modal-body">
  
                      <div id ="carousel" class="carousel-inner">
                      </div>
  
                      <a class="left carousel-control" role="button" data-slide="prev" href="#lb-gallery1-2">
  