" tag. ..}" will do."/> " tag. ..}" will do.">
Home > Article > CMS Tutorial > How to add loading prompt in WordPress article title link
How to add a loading prompt to the WordPress article title link?
The example in this article describes how to add a loading prompt to the WordPress article title link. Share it with everyone for your reference. The specific analysis is as follows:
Recommendation: "wordpress tutorial"
We will see many friends who use wordpress blogs. When we click on the title of the article, It will first prompt that it is loading, and then enter the article. Here we will introduce to you the effect of adding a loading prompt to the WordPress article title link.
First open the header.php template file of the theme you are using, Add the following code before the 9c3bca370b5104690d9ef395f2c5f8d1 tag:
The code is as follows:
<script type="text/javascript" src="js/jquery-1.2.3.min.js"></script>
If your theme has loaded JQuery, this step is unnecessary, and then add the following code in the same way Before adding the 9c3bca370b5104690d9ef395f2c5f8d1 tag, the code is as follows:
The code is as follows:
<script type="text/javascript"> $(document).ready(function() { $('h2 a,h3 a').click(function(){ myloadoriginal = this.text; $(this).text('正在给力加载中 …'); var myload = this; setTimeout(function() { $(myload).text(myloadoriginal); }, 2011); });}); </script>
where "h2 a" is the tag selector for the title of the topic article, which can be modified according to the specific theme template , if changed to: "a", this special effect can be added to all links. The following number 2011 is the display time (milliseconds) of this special effect, which can be modified as appropriate.
The above is the detailed content of How to add loading prompt in WordPress article title link. For more information, please follow other related articles on the PHP Chinese website!