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

Embedding video or html content into the body #470

Closed
charlesanim opened this issue Jul 31, 2019 · 8 comments
Closed

Embedding video or html content into the body #470

charlesanim opened this issue Jul 31, 2019 · 8 comments
Labels

Comments

@charlesanim
Copy link

Is there any way to modify or inject a video object or html content or even customize whats in the steps body. Like the replace the text key with an image key or video.

I've tried every method but none seems to work. Thoughts?

See code below.

shepherd.addStep('health', { title: 'Health Team', text: 'Pariatur fugiat proident nisi fugiat enim laboris qui dolore exercitation sint enim magna velit.', attachTo: { element: '.step-4', on: 'left' }, buttons: [{ action: shepherd.back, classes: 'shepherd-button-secondary', text: 'Back' }, { action: shepherd.next, text: 'Next' }] });

@RobbieTheWagner
Copy link
Member

@charlesanim text supports html. You can just pass an html string.

@RobbieTheWagner
Copy link
Member

Please let me know if this works for you!

@charlesanim
Copy link
Author

charlesanim commented Jul 31, 2019

Thanks for the response,

So I'm trying to pass a <div id="lottieAnim"></div>

And render Lottie a animation using the id.

But it doesnt seem to work.

I even tried to place a html5 video in there but nothing worked. Please what am I doing wrong?

#Help. Thanks

@RobbieTheWagner
Copy link
Member

@charlesanim without seeing your code, I wouldn't know. You can pass raw html in as text. For example:

text: `<p>Hi!</p>`

@charlesanim
Copy link
Author

Ok, I'll push my code to a repo for you to check out.

but I was trying to text: <div id="lottieAnim"></div>

and once that renders, I target the ID with Lottie to render the animation in that element.

Please checkout lottie here, Lottie by Airbnb

@RobbieTheWagner
Copy link
Member

@charlesanim here is an example using <video> https://codepen.io/rwwagner90/pen/jgwEeq

@RobbieTheWagner
Copy link
Member

Your text has to be a string, so you would want

text: `<div id="lottieAnim"></div>`

@charlesanim
Copy link
Author

Thank you, I will check it out and get back to you. Thanks much.

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

No branches or pull requests

2 participants