Coder Social home page Coder Social logo

Click image > next about baguettebox.js HOT 15 CLOSED

bakman2 avatar bakman2 commented on May 17, 2024
Click image > next

from baguettebox.js.

Comments (15)

feimosi avatar feimosi commented on May 17, 2024

Hi,
I was thinking about that feature at the beginning, but then it came to
my mind that I'd need some kind of overlay over the image, what could
prevent right-click mouse actions like 'save image as', so I gave up
that idea.

Regarding the arrows, it's impossible with CSS as they're hardcoded as
SVG in the .js file. Of course you can always change the color by
modifying that file, but I'll think about a new options' field in a
future release.

On 18-Apr-15 6:30 PM, bakman2 wrote:

As subject, is this possible somehow ?

Maybe also nice to make it possible to change the arrow colors via
options or css.


Reply to this email directly or view it on GitHub
#23.

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

I am trying to fix it myself for the click.

I have added:

 bind(overlay, 'click', function(event) {
        showNextImage();
    });

This works, except when using touch outside the overlay, it will exit the lightbox while going to the next image.

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

fix:

  bind(overlay, 'click', function(event) {
        if(event.target && event.target.nodeName !== 'IMG' && event.target.nodeName !== 'FIGCAPTION'){
            hideOverlay();
        }
        else{
            showNextImage();
        }
    });

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

I see, but this works only for moving forward. It's more common when you have the image divided into two-clickable areas.
Anyway I don't see the need for that in this script, but feel free to use it yourself.
Regards

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

agreed. it works for me.

btw in Safari on OSX 10.10 the gallery behaves quite slow and stutters, would could be the cause of this ?

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

Example: www.richardbakker.com

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

hmm hard to say, unfortunately I don't have access to OSX to test that. If it happens only on Safari, you could check out older / newer versions. The animations are based on CSS transitions, so it may be some rendering engine problem.

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

It happens on chrome as well albeit a little better.

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

That's strange, but there's not much I can do right now.

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

Strange indeed. It appears to be caused by the loading-spinner.
I have commented it out and it works perfectly now:

   // figure.innerHTML = '<div class="spinner">' +
    //     '<div class="double-bounce1"></div>' +
    //     '<div class="double-bounce2"></div>' +
    //     '</div>';
   // var spinner = document.querySelector('#baguette-img-' + index + ' .spinner');
        // figure.removeChild(spinner);

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

Ok, I see, so it looks like the rendering engine can't hold it all. Strange as the spinner is a simple css animation.
I hope that's a temporary problem, because the only solution as you've noticed is to remove it entirely.

from baguettebox.js.

bakman2 avatar bakman2 commented on May 17, 2024

I suspect it is not the animation, but creating/removing elements is quite expensive DOM manipulation.

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

Any ideas how to optimize it? Considering that each image has its own loading spinner.

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

Does the stuttering still occur on OSX?

Regarding the colors changing via options, I've been thinking about a possible solution, but unfortunately there isn't any reasonable one as it relies on css and :hover.

from baguettebox.js.

feimosi avatar feimosi commented on May 17, 2024

@bakman2 can I close this issue? Couldn't be reproduced.

from baguettebox.js.

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.