Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightcase plugin doesn't work on first click - on me #176

Open
zonky2 opened this issue Apr 16, 2020 · 0 comments
Open

lightcase plugin doesn't work on first click - on me #176

zonky2 opened this issue Apr 16, 2020 · 0 comments

Comments

@zonky2
Copy link

zonky2 commented Apr 16, 2020

Hi, I change an old site and I`ll replace the colorbox to lightcase

at old site: https://www.gut-cert.de/produkte/nachhaltigkeit/lieferketten/rspo.html see the SVG-Image at end of the site and click at one hotspot...

I change the code to

    <script>
        $(document).on('click', '.lightcase_content', function (event) {
            event.preventDefault();
            let $this = $(this);
            $this.lightcase({
                maxWidth: '95%',
                maxHeight: '95%',
                opacity: '0.5',
                inline: {
                    width: 'auto',
                    height: 'auto'
                },
                href: $this.attr('xlink:href'),
            });
            console.log('click lightcase_content');

            $('.lightcase_close').click(function () {
                console.log('click close');
                $('.lightcase-icon-close').click();
            });
        });
    </script>

btw: xlink:href because svg links

and works, but the lightcase opens only at the second click - the same at my "<"/">"-Buttons

at console I can see, that the click fire every time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant