the following is the JS local preview image used by the code snippet
, which is uploaded and loaded into the pre-written DIV, and then the pop-up prompt of the subsequent function quickly overwrites
and even the pop-up prompt of other functions cannot be used after the image is loaded. I have been confused for a long time to find a solution.
function PreviewImage(divImage, upload) {
if (checkPic()) {
try {
//console.log(upload.files[0]);
var imgPath = getObjectURL(upload.files[0]);
// $(".divImage").css("background","url(imgPath)")
document.getElementById(divImage).innerHTML = "<img id="imgPreview" class="bgimg1" src="" + imgPath + "" width="" + "100%" + "" height="" + "100%" + ""/>";
$(".menu").hide();
$(".menuswitch1").removeClass("menuswitch1").addClass("menuswitch");
var appElement = document.querySelector("[ng-controller=screenCtrl]");
var $scope = angular.element(appElement).scope();
$(".success_text").html("");
$scope.$apply(function () {
$scope.success_display = false;
})
setTimeout(function () {
$scope.$apply(function () {
$scope.success_display = true;
})
}, 2000);
} catch (e) {
alert("");
}
}
}