Giter VIP home page Giter VIP logo

Comments (3)

artpolikarpov avatar artpolikarpov commented on May 23, 2024

Fotorama has its own preloader, four running dots.

To see it at the very beginning you have to reserve space on the page by specifing dimensions. Also you can see it when you jump to the not-loaded region, for example from 1 to 4 image:

screen shot 2013-07-17 at 1 33 19 am

It is by design that the hidden fotorama does not start. Try another way to hide it, something like:

.fotorama {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

The fotorama:ready event always come before any fotorama:load. So If you still want you own preloading animation, use this snippet:

$('.fotorama').on('fotorama:load', function (e, fotorama, data) {
  if (data.index === 0) {
   // The first image has been loaded
  }
});

from fotorama.

calebbergman avatar calebbergman commented on May 23, 2024

Ooookay. I got it now.

Identifying exactly what the issue was was part of the problem. What was happening was, as the anchor/image tags for the navigation thumbnails were being created, the thumbnail images were being displayed to the screen (which was annoying). This is primarily what I wanted to hide.

<div class="fotorama"
        ...
        >
        @foreach (var imageName in Model.ImageNames)
        {
              <a data-full="@Url.Content(Model.FullScreenImagePath + imageName)"
                   href="@Url.Content(Model.CarouselImagePath + imageName)">
                   <img alt="" src="@Url.Content(Model.ThumbnailPath + imageName)" />
              </a>
        }
</div>

Simply hiding those anchor tags as they're being built does the trick. Fotorama seems to subsequently put everything into place after it's ready; no need to manually re-show the anchor tags. And I can still hide my custom .png animation with fotorama's ready event.

.fotorama a
{
    display: none;
}

My apologies. Thank you for the explanations, though.

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 23, 2024

You are clever. On fotorama.io I did the similar trick:

.fotorama > * {
  visibility: hidden;
}

.fotorama > .fotorama__wrap {
  visibility: visible;
}

But it is not included to the fotorama.css because I don’t want to break no-javascript compatibility by default. But this is subject to rethink.

from fotorama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.