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

I need my confetti with in a particular div or component in angular 4 , How can i get that ? #70

Closed
santhanakrishnanstark opened this issue Sep 23, 2019 · 6 comments
Labels
question Further information is requested

Comments

@santhanakrishnanstark
Copy link

By default it covers entire viewport.

@santhanakrishnanstark
Copy link
Author

I need my confetti with in a particular div or component in angular 4 , How can i get that

@catdad
Copy link
Owner

catdad commented Sep 23, 2019

You can create your own instance of confetti in your own canvas: https://github.com/catdad/canvas-confetti#confetticreatecanvas-globaloptions--function

The last example on the demo site also shows this scenario.

// get a canvas that already exists on the page
var canvas = document.getElementById('custom-canvas');

var myConfetti = confetti.create(canvas, {
    resize: true
});

myConfetti({
    spread: 70,
    origin: {
        y: 1.2
    }
});

@catdad catdad added the question Further information is requested label Sep 23, 2019
@santhanakrishnanstark
Copy link
Author

@catdad So that can i position the canvas element where i want right ? i will check

@catdad
Copy link
Owner

catdad commented Sep 29, 2019

Correct, you can style your canvas any way you'd like. Take a look at this demo for reference.

@catdad catdad closed this as completed Sep 29, 2019
@lavanyav0523
Copy link

lavanyav0523 commented Mar 1, 2023

@catdad but can we put a few html elements behind this canvas-confetti using this method in that particular block?

@catdad
Copy link
Owner

catdad commented Mar 4, 2023

You can do anything you'd like. It's your web page.

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

No branches or pull requests

3 participants