• We share Bootstrap themes, PHP scripts, XenForo Styles & Addons in the community. You can also buy or sell websites, domains, advertising, services and articles.
  • IMPORTANT NOTICE:
    VIP members can buy/sell in the marketplace and download VIP resources from the VIP arena. All these features are as low as $4.90/month. - Register Now

Lazy Carousel in Bootstrap

subet

Administrator
Staff member
An easy-peasy way to lazy load images in a bootstrap carrousel:
  1. Use data-src instead of src for all but the first image.
  2. Add lazy class to the carousel (optional, just to have an opt-in class for lazy carousels).
  3. At the slide event, set the src attribute on the not-lazy-anymore image.

HTML code:
Code:
<div class="carousel slide lazy">
  <div class="carousel-inner" role="listbox">
      <div class="item active">
        <img src="first-image.jpg" alt="First image">
    </div>
    <div class="item">
        <img data-src="second-image.jpg" alt="Second image">
    </div>
  </div>
</div>

Javascript code:
Code:
$(function() {
  return $(".carousel.lazy").on("slide", function(ev) {
    var lazy;
    lazy = $(ev.relatedTarget).find("img[data-src]");
    lazy.attr("src", lazy.data('src'));
    lazy.removeAttr("data-src");
  });
});
 

wamplerpen56

New member
Just changed it today. Actually, I was too bored because of it. Using the same thing while having a new one seems like I am in some way. That is why I decided to change it with Xs Max. I hope now I will enjoy new features and new advanced innovations. Visit this website to see some good flooring options just like NAF flooring Canada. I just selected this floor for my home. Hope you will also like it. If you want to see some options according to your choice at a very low cost then you can visit this website squarefootflooring.com
 

Bernard

New member
  • Use data-src instead of src for all but the first image.
  • Add lazy class to the carousel (optional, just to have an opt-in class for lazy carousels).
  • At the slide event, set the src attribute on the not-lazy-anymore image.
mcdvoice survey
 
Last edited:

JasonFax

New member
Sell casino script Goldsvet 8.X NULLED. SOURCE CODE

A new version of GOLDSVET / mrs system. In this issue you will find new features for managing games and the system, the unification of
game banks, a significant increase in performance and a decrease in the load on the server and database. Several new unique interfaces,
as well as updating the Laravel Framework to version 8.14.0.

Our casino script:
1) has no domain restrictions.
2) all games are open source.
3) 960+ games in total.
4) all games work on a computer and on a phone, and have html5 format.

Casino price: 2500 EUR
Goldsvet MRS Core 8.0 DECODED (NULLED) + GAMES
Video review:
Contacts:
telegram: https://t.me/kseGB
mail: [email protected]
site: http://win-game.net/
 
Top