Created
February 1, 2020 05:14
-
-
Save ridhotegar/b7eb51aa3e573eb90024e5e633a856d2 to your computer and use it in GitHub Desktop.
Simple OnLoad Loading JQuery CodeIgniter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- loading CSS --> | |
<style type="text/css"> | |
.preloader { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
z-index: 9999; | |
background-color: #fff; | |
} | |
.preloader .loading { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
transform: translate(-50%, -50%); | |
font: 14px arial; | |
} | |
</style> | |
<!-- stop loading --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script> | |
$(window).load(function() { | |
$(".preloader").fadeOut(); | |
}) | |
</script> | |
<!-- run loading --> | |
<div class="preloader"> | |
<div class="loading"> | |
<img src="<?php echo base_url('asset/img/Loader.gif') ?>" width="80"> | |
<p> | |
<br>Harap Tunggu</p> | |
</div> | |
</div> | |
<!-- end run loading --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Call With : | |
<?php $this->load->view('loading'); ?> | |
File location : | |
loading.php on views folder | |
Custom Call function : | |
$(".preloader").fadeIn(); | |
Stop function : | |
$(".preloader").fadeOut(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment