Skip to content

Commit

Permalink
after loading all page elements(including images), hide the preloader (
Browse files Browse the repository at this point in the history
…#88)

* After loading all page elements(including images), hide the preloader

* added fadeout effect to the preloader
  • Loading branch information
jyarali authored and arc9693 committed Oct 16, 2019
1 parent 24cd054 commit 283da9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
4 changes: 4 additions & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ $(function () {
$('html, body').animate({ scrollTop: $($(this).attr('href')).offset().top }, 500, 'linear');
});
});
// after loading all page elements(including images), hide the preloader
$(window).on('load', function() {
$("#wrapper").fadeOut('slow');
});
17 changes: 3 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
crossorigin="anonymous"
/>
<link rel="stylesheet" href="assets/styles/main.css" />
<script>
function removeloader() {
document.getElementById('wrapper').style.display = 'none';
}
</script>
</head>
<body onload="removeloader()">
<body>
<div id="wrapper">
<svg
width="65px"
Expand Down Expand Up @@ -142,12 +137,9 @@ <h3 class="time">
Made with <span id="hearts">&hearts;</span> by GNU Linux Users' Group
</footer>

<!--jquery library full-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<!--bootstrap libraries-->
<script
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
Expand All @@ -161,9 +153,6 @@ <h3 class="time">
<!--Vanilla tilt library-->
<script src="https://unpkg.com/[email protected]/dest/tilt.jquery.min.js"></script>

<!--jquery library full-->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<!--main library-->
<script src="assets/js/main.js"></script>

Expand Down

0 comments on commit 283da9c

Please sign in to comment.