Ich habe eine jQuery-Zyklus Präsentation Seite, die etwa 48 Folien enthält. Das Problem besteht darin, dass die anfängliche Belastung aller Assets einige Zeit in Anspruch nimmt, sodass die Seite für etwa 1-5 Sekunden verzerrt aussieht. Gibt es eine Möglichkeit, die Assets, die für jede Folie benötigt werden, nur dann zu laden, wenn die Folie aufgerufen wird oder die Folie als vorherige oder nächste Folie bekannt ist?jQuery Cycle Lazy Loading
5
A
Antwort
5
Das jquery Zyklus2 Plugin ermöglicht progressive Belastung: http://jquery.malsup.com/cycle2/demo/progressive.php
<div class="cycle-slideshow auto"
data-cycle-fx="scrollHorz"
data-cycle-timeout="2000"
data-cycle-caption=".caption1"
data-cycle-caption-template="{{slideNum}}/9"
data-cycle-loader="true"
data-cycle-progressive="#images"
>
<!-- only one image declared in markup -->
<img src="http://jquery.malsup.com/cycle2/images/beach1.jpg">
<!--
JSON array of slides to be loaded progressively,
nested inside a script block. The script block does not need
to be inslide the slideshow container, it can be anywhere on the
page. Note the type on the script tag.
-->
<script id="images" type="text/cycle">
[
"<img src='http://jquery.malsup.com/cycle2/images/beach2.jpg'>",
"<img src='http://jquery.malsup.com/cycle2/images/beach3.jpg'>",
...
"<img src='http://jquery.malsup.com/cycle2/images/beach9.jpg'>"
]
</script>
</div>
<div class="center caption1"></div>
Verwandte Themen
- 1. Implizite Lazy Loading vs Explizite Lazy Loading
- 2. Lazy Loading vs Eager Loading
- 3. UITableView Lazy Loading Optimierung
- 4. Lazy Loading in NHibernate
- 5. JFreeChart & Lazy loading
- 6. Federdaten Hibernate Lazy Loading
- 7. Doktrin lazy loading
- 8. ASP.NET HoverMenuExtender Lazy Loading
- 9. Android listview lazy loading
- 10. Lazy Loading UICollectionView Bilder
- 11. lazy loading und $ ocLazyLoad
- 12. Verwendet URLClassLoader Lazy Loading?
- 13. webpack 2 lazy loading
- 14. C# Ajax Lazy Loading
- 15. Lazy Loading with Ninject
- 16. Lazy loading Navigationseigenschaften
- 17. gwt lazy loading
- 18. Lazy loading, Deferred Laden, eifrig Loading LINQ
- 19. Schienen 3: Lazy Loading versus Eager Loading
- 20. Lazy loading, Deferred Loading und Eager Loading im Entity-Framework
- 21. NSCollectionView lazy-loading-ähnliches Verhalten
- 22. Problem mit Lazy Loading-Implementierung
- 23. Lazy Loading Variablen in Vorlagen
- 24. Lazy Loading in Rails 3.2.6
- 25. Lazy Loading vermeiden Doctrine Symfony2
- 26. Entity Framework Lazy Loading perfomance
- 27. Async Lazy Loading mit Aufgaben
- 28. Hibernate Lazy Loading wirft JsonMappingException
- 29. Lazy Loading templates in Meteor
- 30. Ist Lazy Loading wirklich schlecht?