lightcase icon indicating copy to clipboard operation
lightcase copied to clipboard

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

Open zonky2 opened this issue 5 years ago • 0 comments

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

zonky2 avatar Apr 16 '20 09:04 zonky2