Git Product home page Git Product logo

lsb-lightbox's People

Contributors

alexemashev avatar evc54 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lsb-lightbox's Issues

Programatically launch the lightbox

I am looking for a way of launching the lightbox from javascript, as I have several places where the images are not linked
in the HTML but I still would like to launch the lightbox from javascript.

Is there a way of doing this ? Or do I need to add "hidden" links and trigger them ?

I tried being clever, however that didnt' work :D A temporary sollution would be to add a set of links in a hidden part og the page, now all I need to do is click them from javascript - as lsb-lighbox is already active on the links after page load.

<a href="URL_LINK_1" id="myid1" class="lsb-preview" data-lsb-group="tag">Image name 1</a>
<a href="URL_LINK_2" id="myid2" class="lsb-preview" data-lsb-group="tag">Image name 2</a>

At first neither og theese worked as simulating a link:

$('#myid1').click(); // doesnt work 
$('#myid1').trigger('click'); // doesnt work 
$('#myid1')[0].click(); // doesnt work
$('#myid1.lsb-preview').click(); // doesnt work 
$('#myid1.lsb-preview').trigger('click'); // doesnt work 
$('#myid1.lsb-preview')[0].click(); // doesnt work

It does seem that this one works though, I tried going through the entuire "click" manually and it does open:

    var simMousedownEvent = new MouseEvent('mousedown', {
        'view': window,'bubbles': true,'cancelable': true
    });
    $('#myid1.lsb-preview')[0].dispatchEvent(simMousedownEvent);
    let simClick = new MouseEvent("click", {
        bubbles: true,cancelable: true,view: window
    });
    $('#myid1.lsb-preview')[0].dispatchEvent(simClick);
    var simMouseupEvent = new MouseEvent('mouseup', {
        'view': window,'bubbles': true,'cancelable': true
    });
    $('#myid1.lsb-preview')[0].dispatchEvent(simMouseupEvent);

Are there any other ways of doing this ?

Possibility of adding custom buttons

Hi,

Is there a built-in way to add custom buttons similar to download button.

If not it would be cool if that available in next releases.

Thanks

Indunil

Switching Images

When switching to the next image it flashes the previous image then changes to the new image. Is there a way to stop this?

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.