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

open content on click event from js on demand #19

Closed
mmgafri opened this issue Oct 27, 2018 · 1 comment
Closed

open content on click event from js on demand #19

mmgafri opened this issue Oct 27, 2018 · 1 comment

Comments

@mmgafri
Copy link

mmgafri commented Oct 27, 2018

hello
first i want to thank u for the great plugin

I have a need to assign dynamic created divs to preview video and image

and i can create divs as follow


<div id="vid1" filesrc="files/vid2.mp4" onclick="previewfile(this); />
<div id="vid2" filesrc="files/vid2.mp4" onclick="previewfile(this); />

<script>
function previewfile(e){
myvidSrc=e.getAttribute('filesrc')
//code to open bigpicture directly without initialization
//.......
}
</script>

due to heavy ajax usage I cannot use the initialize constructure on dynamic created div
therefore would it be possible to open the preview from such external function

@henrygd
Copy link
Owner

henrygd commented Oct 28, 2018

If I'm understanding you correctly, this should work out of the box. No need for initialization or anything.

I took your code and made a codepen. Let me know if it helps:

https://codepen.io/anon/pen/EdMGJM

@henrygd henrygd closed this as completed Nov 10, 2018
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

2 participants