$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>jquery - How to add gif as preloader in wordpress?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

jquery - How to add gif as preloader in wordpress?

matteradmin9PV0评论

I am trying to use a gif as preloader in wordpress. I want this gif to show exactly 5 seconds. I have found ways to do that in html/css/js but could not find how to do that in WordPress. I have found several plugin related to this but none of it really meets my requirement. Can anyone please help me here?

I am trying to use a gif as preloader in wordpress. I want this gif to show exactly 5 seconds. I have found ways to do that in html/css/js but could not find how to do that in WordPress. I have found several plugin related to this but none of it really meets my requirement. Can anyone please help me here?

Share Improve this question asked Jan 15, 2019 at 7:37 rizbanul hasanrizbanul hasan 1 4
  • 1 You want your site to take 5 seconds to load? Why on earth would you want that? – Jacob Peattie Commented Jan 15, 2019 at 7:57
  • Its one of the requirements of the client! :( Can you help? – rizbanul hasan Commented Jan 15, 2019 at 8:35
  • Fulfilling this request would be doing them a disservice. 40% of visitors will leave a website if it doesn't load in 2 seconds, allegedly. Are you sure you're not misinterpreting them? – Jacob Peattie Commented Jan 15, 2019 at 8:39
  • Yes. They gave a gif and asked to show its full length. Well, length can be reduced. But can you tell me how to do it? – rizbanul hasan Commented Jan 15, 2019 at 9:57
Add a comment  | 

1 Answer 1

Reset to default -1

add your code with class for ex .loading-wrapper in your header then add this code in your script

setTimeout(function(){
$('.loading-wrapper').slideUp();}, 5000);
Post a comment

comment list (0)

  1. No comments so far