Coder Social home page Coder Social logo

Comments (3)

henrygd avatar henrygd commented on August 16, 2024

I'd be happy to help you figure it out. Can you post a snippet of your code, or make an example on codepen or codesandbox?

from bigpicture.

creativeDM avatar creativeDM commented on August 16, 2024

I'd be happy to help you figure it out. Can you post a snippet of your code, or make an example on codepen or codesandbox?

Here is link of code - https://codesandbox.io/s/bigpicturejs-demos-utx4u?file=/index.html
I tried this one with youtube-video
this running well at first view, but after i add svg icon to the button, after refresh it didn't work again and showing the same issue - Error: The requested image could not be loaded.

Thanks for your time.
and Thanks too for awesome & cool lightbox plugin.. Keep it up..

I also love your another script side-panel like thing. really cool and lightweight, will use it also in near future..

Keep it on brother. but make it little easier to get done with demos for average JS users like me

from bigpicture.

henrygd avatar henrygd commented on August 16, 2024

No problem! You can make it work by changing e.target to e.currentTarget like this:

BigPicture({
  el: e.currentTarget,
  ytSrc: e.currentTarget.getAttribute("ytSrc")
});

After you put the svg inside the button, e.target becomes the svg when it's clicked (it's the element you clicked to trigger the event). e.currentTarget is always the button even when an element inside is clicked (because it's what you assigned the event listener to). It was failing because the svg does not have the ytSrc attribute.

Here's the working code: https://codesandbox.io/s/bigpicturejs-demos-forked-mwvtq?file=/index.html:3391-3525

I'm going to close this issue, but feel free to follow up with any question or comment.

from bigpicture.

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.