Giter VIP home page Giter VIP logo

Comments (14)

artpolikarpov avatar artpolikarpov commented on May 26, 2024

API docs are on the way. There are a few examples, where you can see some of the special Fotorama events and methods in action:

Back to your question: CSS is the better way to change thumbnails border width and color. I am not planning to add options or methods to change thumbs border.

from fotorama.

joshuataylor avatar joshuataylor commented on May 26, 2024

Is there a way to load JSON data into Fotorama 4 like it was possible for Fotorama 3?

Really liking Fotorama4, started playing around with Fotorama 3 when 4 was released, which is nice.

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 26, 2024

Dear @joshuataylor, sure.

Take some empty div:

<div id="gallery"></div>

And then:

// Initialize fotorama in it
var $gallery = $('#gallery').fotorama({nav: 'thumbs'}),
    // Get access to the API
    fotorama = $gallery.data('fotorama');

// Load photos
fotorama.load([
  {img: '1.jpg', thumb: '1-thumb.jpg'},
  {img: '2.jpg', thumb: '2-thumb.jpg'},
  {img: '3.jpg', thumb: '3-thumb.jpg'}
]);

The complete image object may look like so:

{
  img: '1.jpg',
  thumb: '1-thumb.jpg', // if you are using the `nav:'thumbs'` option
  full: '1-full.jpg', // separate image for the fullscreen mode
  id: 'one', // custom anchor, used with the `hash:true` option
  fit: 'cover' // override the global fit option
}

from fotorama.

bender-r avatar bender-r commented on May 26, 2024
{
  img: '1.jpg',
  thumb: '1-thumb.jpg', // if you are using the `nav:'thumbs'` option
  full: '1-full.jpg', // separate image for the fullscreen mode
  id: 'one', // custom anchor, used with the `hash:true` option
  fit: 'cover' // override the global fit option
}

если это полный список, как передать caption и html ?

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 26, 2024

Попробуйте:

{
  caption: 'Good caption'
  html: $(el) // or '<div>123</div>'
}

from fotorama.

bender-r avatar bender-r commented on May 26, 2024

Спасибо!

from fotorama.

mistakster avatar mistakster commented on May 26, 2024

Take some empty div

As I see in code, If Fotorama is initialized on empty div then it destroy itself immediately. Is it an issue or behavior “by design”?

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 26, 2024

@mistakster, it is by design, fotorama.load() will revive the instance.

from fotorama.

mistakster avatar mistakster commented on May 26, 2024

@artpolikarpov, actually, it remove empty div from document and sometimes return undefined for data('fotorama'). Please, take a look at console while running http://jsfiddle.net/k6dnC/

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 26, 2024

@mistakster, let’s continue here: #42.

from fotorama.

samu1241 avatar samu1241 commented on May 26, 2024

@artpolikarpov how can I add start & stop button on fullscreen mode? Thanks in advance.

from fotorama.

artpolikarpov avatar artpolikarpov commented on May 26, 2024

@samu1241 what is particularly difficult?

from fotorama.

ppovoroznuk avatar ppovoroznuk commented on May 26, 2024

Hello, Artem!
Thank you for your great work and sharing it with the community.

Can you, please, give me an advice on one thing.
I'm using Fotorama Wordpress plugin and I would like to achieve the same behaviour as you're showing here - http://fotorama.io/examples/events.html - a gallery with an images counter instead of the dots.

What would you say is the best way to do this?

from fotorama.

ppovoroznuk avatar ppovoroznuk commented on May 26, 2024

Found a solution.
Added the following code to fotorama-wp.js:

    $('.fotorama--wp')      
        .fotoramaWPApapter()

        // what I added starts here
        .on('fotorama:ready', function (e, fotorama, direct) {
            $(this).prepend("<mark class='position_indicator'></mark>");
            $(this).find('.position_indicator').text((fotorama.activeIndex + 1)
                        + '/' + fotorama.size);
        })      
        .on('fotorama:show', function (e, fotorama, direct) {
                $(this).find('.position_indicator').text((fotorama.activeIndex + 1)
                        + '/' + fotorama.size);
        })
        // what I added ends here

        .fotorama();

This also works with several Fotoramas on a page.

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.