简体   繁体   中英

Can you put one canvas inside another canvas?

basically, i have 2 javascripts(easelJS with add scripting) that run on 2 different canvas elements in my html index file.

i was wonder, if i can sort of "wrap" those two inside a main canvas element, and thus have more power to play with their layout opposed to one another, rather than relying on html/css positioning.

Is it possible?

Thanks!

Nesting canvas inside another canvas is possible. Say something like this:

<canvas id="outer">
    <canvas id="inner"></canvas>
</canvas>

Not sure if this answers your question, but you can refer Canvas inside canvas of html5 for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM