Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added load more buttton as suggest in issue #737 #743

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ <h4 id="counter"></>

</div>
<div class="loading show">
<!-- <div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div>
<div class="ball"></div> -->
</div>
</div>

<div class="Show-more">
<button id="Show-more_button" onclick="showLoading()">Load more</button>
</div>

<!-- CARD SECTION ENDED -->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

![image](https://user-images.githubusercontent.com/58311460/220091418-0e23061f-bdff-44f3-8274-bea5f8011c2d.png)


Expand Down
8 changes: 4 additions & 4 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ProjectCounter = document.getElementById('counter')

// Infinite scrolling
var doLoadingOnScroll = true
var noOfCardsToLoad = 12
var noOfCardsToLoad = 5
var cardLoadedYet = 0
var loadingBalls = false
const loading = document.querySelector('.loading')
Expand All @@ -59,7 +59,7 @@ window.addEventListener('scroll', () => {
) {
// show the loading animation
// setTimeout(showLoading,1000);
showLoading()
// showLoading()
}
})

Expand All @@ -69,7 +69,7 @@ function showLoading() {
// showNextItems();
if (loadingBalls == false) {
loadingBalls = true
setTimeout(showNextItems, 1000)
setTimeout(showNextItems, 500)
}
}

Expand Down Expand Up @@ -128,7 +128,7 @@ const getProject = fetch('style_links.json')
//extra arr bna aur km store kr vohi display kra aur append krtey jaa
//search real waley se krna
// displayProjects(projects)
showLoading()
showNextItems()
console.log(projects)
})

Expand Down
13 changes: 13 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ a {
transform: translate(50%, -200%);
}

.Show-more{
display: flex;
width: 50%;
margin: 0 auto;
}
.Show-more button{
border-color: none;
font-size: 20px;
width: 15vw;
height: 7vh;
margin: 10px auto;
border-radius: 30px;
}


.nav-link{
Expand Down