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 #562

Closed
wants to merge 2 commits into from
Closed

Lazy loading is added #562

wants to merge 2 commits into from

Conversation

shraddha761
Copy link
Contributor

@shraddha761 shraddha761 commented Jul 1, 2023

Related Issue

Closes #537

Proposed Changes

In the code, I have 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.

Additional Info

  • Any additional information or context

Checklist

  • ✅ My code follows the code style of this project.
  • 📝 My change requires a change to the documentation.
  • 🎀 I have updated the documentation accordingly.
  • 🌟 ed the repo
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Output Screenshots

Screenshot #1 Screenshot #2
Title goes here Title goes here
Image goes here Image goes here

@netlify
Copy link

netlify bot commented Jul 1, 2023

Deploy Preview for codesetgo ready!

Name Link
🔨 Latest commit 044b974
🔍 Latest deploy log https://app.netlify.com/sites/codesetgo/deploys/649ffc82a0c6860007381ef0
😎 Deploy Preview https://deploy-preview-562--codesetgo.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

@agamjotsingh18 Can you review the PR.

@agamjotsingh18
Copy link
Owner

It has merge issues, fetch the latest code, will merge then

@shraddha761 shraddha761 closed this by deleting the head repository Jul 11, 2023
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
2 participants