第一张图片在chrome中不可见

时间:2017-12-08 07:35:52

标签: javascript jquery css twitter-bootstrap google-chrome

幻灯片的第一张图片未显示在Chrome浏览器中。它似乎在Safari和Internet Explorer上都能正常工作。我已经给出了代码的样式表和功能。

CSS

.hidden {
  display: none;
}

.imgSize {
  height: 40px;
  width: 70px;
}

.carousel-inner>.item>img,
.carousel-inner>.item>div,
.carousel-inner>.item>a>img {
  width: 100%;
  margin: auto;
}

.modal1 {
  display: none;
  position: fixed;
  z-index: 1;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0, 0, 0);
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content1 {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 614px;
  max-height: 400px;
}

.modal-content1,
#caption {
  -webkit-animation-name: zoom;
  -webkit-animation-duration: 0.6s;
  animation-name: zoom;
  animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
  from {
    -webkit-transform: scale(0)
  }
  to {
    -webkit-transform: scale(1)
  }
}

@keyframes zoom {
  from {
    transform: scale(0)
  }
  to {
    transform: scale(1)
  }
}

.close-popup {
  position: absolute;
  top: 60px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
}

.download-file {
  position: absolute;
  top: 66px;
  right: 70px;
  color: #f1f1f1;
  font-size: 25px;
  font-weight: bold;
  transition: 0.3s;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

@media only screen and (max-width: 700px) {
  .modal-content {
    width: 100%;
  }
}

JS

$("[id^=viewDocs]").on("click", function() {
  var docId = $(this).attr("id");
  var docIndex = docId.substr(docId.length - 1);
  var activeItemId = $(this).data("value");
  $("div>div.item").removeClass("active");
  $("#" + activeItemId).addClass("active");
  var appName = $('#SavepatientResultsDetails_appName').val();
  var paramValue = $(this).data("id");
  $("#myModal").removeClass("hidden");
  $('#downloadDocId').attr('href', appName + '/apps/PatientDetailsDoctor/ViewPatientTestResults/downloadUploadDocs?testResultsDocsId=' + paramValue);
  var modal = document.getElementById("myModal");
  modal.style.display = "block";

});

$('#myCarousel').on('slide.bs.carousel', function(ev) {
var itemId = ev.relatedTarget.id;
var paramValue = $('#' + itemId).data('value');
var appName = $('#SavepatientResultsDetails_appName').val();
$('#downloadDocId').attr('href', appName + '/apps/PatientDetailsDoctor/ViewPatientTestResults/downloadUploadDocs?testResultsDocsId=' + paramValue);
})

});

我曾尝试更改代码的内部功能,但它对我没有帮助。如果我在风格上有任何错误,请教育我。

0 个答案:

没有答案