Update imageUpload.js
Browse files- imageUpload.js +2 -1
imageUpload.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
// JavaScript函数,用于上传单个图片并返回完整的URL地址
|
4 |
function uploadImageAndGetFullUrl(uploadEndpoint, hostUrl, file) {
|
5 |
const formData = new FormData();
|
6 |
-
|
7 |
const loadingElement = document.createElement('div');
|
8 |
loadingElement.id = 'loading';
|
9 |
loadingElement.textContent = '图片加载中......';
|
@@ -20,6 +20,7 @@ function uploadImageAndGetFullUrl(uploadEndpoint, hostUrl, file) {
|
|
20 |
loadingElement.style.padding = '10px';
|
21 |
loadingElement.style.borderRadius = '5px';
|
22 |
loadingElement.style.zIndex = '1000';
|
|
|
23 |
|
24 |
// 图片压缩功能
|
25 |
function handleCompressFile(file) {
|
|
|
3 |
// JavaScript函数,用于上传单个图片并返回完整的URL地址
|
4 |
function uploadImageAndGetFullUrl(uploadEndpoint, hostUrl, file) {
|
5 |
const formData = new FormData();
|
6 |
+
// 动态创建加载动画元素并添加到页面中
|
7 |
const loadingElement = document.createElement('div');
|
8 |
loadingElement.id = 'loading';
|
9 |
loadingElement.textContent = '图片加载中......';
|
|
|
20 |
loadingElement.style.padding = '10px';
|
21 |
loadingElement.style.borderRadius = '5px';
|
22 |
loadingElement.style.zIndex = '1000';
|
23 |
+
loadingElement.style.animation = 'blink 1s linear infinite';
|
24 |
|
25 |
// 图片压缩功能
|
26 |
function handleCompressFile(file) {
|