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

Lazy loading is added #450

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

shraddha761
Copy link
Contributor

Related Issue

Closes #435

In this code, I added the class "lazy" to the elements to lazy load and specified the URL of the lazy content using the data-src attribute. The script will make an AJAX request to fetch the content from the provided URL and set it as the innerHTML of the lazy element.

Additionally, the code adds a scroll event listener to trigger the lazy loading when the elements come into the viewport. The lazy elements that are already visible on page load will be loaded immediately, while the remaining elements will be loaded as the user scrolls.

Checklist

  • My code adheres to the established style guidelines of the project.
  • I have included comments in areas that may be difficult to understand.
  • My changes have not introduced any new warnings.
  • I have conducted a self-review of my code.

@netlify
Copy link

netlify bot commented Jul 1, 2023

Deploy Preview for joyful-otter-a57da4 ready!

Name Link
🔨 Latest commit 47b6ceb
🔍 Latest deploy log https://app.netlify.com/sites/joyful-otter-a57da4/deploys/64d30fa6ddddb20008e03b38
😎 Deploy Preview https://deploy-preview-450--joyful-otter-a57da4.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@shraddha761
Copy link
Contributor Author

@Dharmesh177 please review

@Dharmesh177
Copy link
Collaborator

Add video of demonstration and screenshots for assess

@shraddha761
Copy link
Contributor Author

Add video of demonstration and screenshots for assess

You will see difference will website load it is more efficient after lazy loading is enabled

@shraddha761
Copy link
Contributor Author

@Dharmesh177 please review my pr

@Dharmesh177
Copy link
Collaborator

It taking too much load I guess now no need of this

@Dharmesh177
Copy link
Collaborator

or need improvement

@shraddha761
Copy link
Contributor Author

Is there any improvement needed

@cleveranu
Copy link
Collaborator

Kindly resolve conflicts and work on latest branch

@shraddha761
Copy link
Contributor Author

@cleveranu I have resolve the conflict please review now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable lazy loading to improve website performance
3 participants