简体   繁体   English

隐藏对象直到页面完全加载

[英]Hide the object until the page is fully loaded

I want to hide the button before the page fully loads.我想在页面完全加载之前隐藏按钮。

Through .css I would add this:通过 .css 我会添加这个:

.checkout-button {
    display: none!important;
}

From my understanding, I would need to add JS/jQuery code with this.根据我的理解,我需要为此添加 JS/jQuery 代码。

Yeah you can wait until the document is ready/loaded.是的,您可以等到文档准备好/加载完毕。 You might also consider disabling it so it does not work.您也可以考虑禁用它,使其不起作用。 https://learn.jquery.com/using-jquery-core/document-ready/ https://learn.jquery.com/using-jquery-core/document-ready/

 $(document).ready(function(){ $('#id1').removeAttr('disabled'); $('#id1').removeClass('checkout-button'); });
 .checkout-button { display: none!important; }
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <input id="id1" type="submit" disabled="disabled" class="checkout-button" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM