简体   繁体   English

单击“ a href”时如何添加预加载器?

[英]How to add a preloader when you click on a “a href”?

Because on iPad I've tried to add :hover :active and :focus over some "a href" and there was not showing any effect, I've decided to add a preloader over page when the page is loading after your click. 因为在iPad上,我尝试在某些“ a href”上添加:hover:active和:focus,并且没有显示任何效果,所以我决定在单击后加载页面时在页面上添加预加载器。 Can anyone explain to me how to add this preloader onclick; 谁能向我解释如何添加此预加载器onclick;

$("#preloader").hide();
document.getElementById("preloader").style.display = 'none';

try this 尝试这个

$(function(){
     $("#yourID").on("click",function(){
         $("#preloader").show();
     });
});

and for hiding use either $("#preloader").hide(); 和隐藏使用$("#preloader").hide(); or 要么

document.getElementById("preloader").style.display = 'none';

you don't have to use both. 您不必同时使用两者。

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

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