亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

單擊提交按鈕時顯示加載 Gif

單擊提交按鈕時顯示加載 Gif

慕森王 2021-11-04 17:50:25
我正在為我的網站使用上傳圖片插件,當用戶在移動設備上單擊提交時,他們看不到任何進度,因此他們一次又一次地單擊提交按鈕,我收到太多相同的帖子,我想在他們顯示加載 gif 圖像時點擊提交按鈕,這是插件表單<form id="usp_form" method="post" enctype="multipart/form-data" action="">\\rest code here<input type="submit" class="usp-submit" id="user-submitted-post" name="user-submitted-post" value="<?php esc_attr_e('Submit Post', 'usp'); ?>"></form>我已經嘗試過在堆棧上找到這個,但沒有用<img src="https://www.punjabidharti.com/wp-content/plugins/wp-email/images/loading.gif" id="img" style="display:none"/ >    <script type="text/javascript">    $('#usp_form').submit(function() {    $('#img').css('visibility', 'visible');});</script>這是我的上傳圖片網址https://www.punjabidharti.com/upload-pictures/希望你能幫助我
查看完整描述

2 回答

?
郎朗坤

TA貢獻1921條經驗 獲得超9個贊

display: none在布局文件中使用 div并display:block在需要時制作


<div style="z-index: 5000; display:none;" id="loadingDiv">

    <table style="margin: 0px auto;">

        <tr>

            <td style="padding-top:200px;" align="center"><img src="https://www.punjabidharti.com/wp-content/plugins/wp-email/images/loading.gif" alt="loading image"/></td>

        </tr>

    </table>

</div>


$('#usp_form').submit(function() {

    // javascript way

    document.getElementById("loadingDiv").style.display = 'block';

    // jquery way

    $('#loadingDiv').show();  

});

更新


layout level files can be any of following:


layout.html

index.html

header.html

footer.html

您可以嘗試另一個 gif 圖像,例如https://i.stack.imgur.com/rBLb3.gif


查看完整回答
反對 回復 2021-11-04
?
慕田峪4524236

TA貢獻1875條經驗 獲得超5個贊

你已經在你的 img 中添加了 'style="display:none"' 但在你正在做的代碼中:

$('#img').css('visibility', 'visible');

你應該做:

$('#img').css('display', 'inline-block');


查看完整回答
反對 回復 2021-11-04
  • 2 回答
  • 0 關注
  • 315 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號