I have a microsite that is utilizing Laravel and Angular. It's a one page microsite that is responsive and is broken into 5 sections. I would like to lazy load them to cut down on loading all at once.
<body ng-app>
<div id="wrapper">
<section id="intro">1</section>
<section id="Second">2</section>
<section id="Third">3</section>
<section id="Fourth">4</section>
<section id="Fifth">5</section>
</div>
</body>
I'm looking to load 1 & 2 on page load then as you scroll down the page load the other view with a nice fade in and then load its interactive items.
In this case it is probably not necessary (or efficient) to lazy load your controllers, but it can be done.
There are many things to tackle here, so I'm going to handle it in sections.
Lazy-loading views on scroll (animated).
Live demo here (click).
Markup:
Animation CSS:
Angular logic:
Lazy-loading CONTROLLERS and views on scroll (animated).
Live demo here (click).
Markup:
Angular Logic: