Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@RenderBody() with canvas

I have a canvas loaded onto the _Layout.cshtml

When I browse from the Index page, to About or Contact, the <canvas> is showing but the page content is missing.

Index page will load a div under <body> tag but About page is missing content.

I'm assuming @RenderBody isn't in the appropriate z-index or is not showing on top of <canvas> like my Index page does.

<canvas id="bgCanvas"></canvas>
<script src="~/Scripts/starLayout.js"></script>

<div class="container body-content">
    @RenderBody()
    <hr />

    <footer>
        <p>&copy; @DateTime.Now</p>
    </footer>
</div>

edit2:

under view source it shows

    <canvas id="bgCanvas"></canvas>
    <script src="/Scripts/starLayout.js"></script>

    <div class="container body-content">


<h2>About.</h2>
<h3>Your application description page.</h3>
<div>
    <p>Use this area to provide additional information.</p>
</div>
        <hr />


        <footer>
            <p>&copy; 4/17/2015 11:33:17 AM - JTR</p>
        </footer>
    </div>

However I still can't see the content so it's underneath the canvas I believe. Which is weird since it is on top of the canvas on index.cshtml

like image 477
jtrdev Avatar asked Apr 17 '15 15:04

jtrdev


1 Answers

Here is your answer: w3c canvas. Shortly, you must provide width and height properties for canvas element.

And remember to place the *.js file/code which is responsible for "drawing" after the canvas element.

Can you provide css code, so I'll be abe to edit this answer to be more specific?

like image 158
Alexandre Ostapenko Avatar answered Nov 02 '22 05:11

Alexandre Ostapenko