25.06.2018 Views

Full-Stack Vue.js 2 and Laravel 5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

flow of the document. We remove it from the flow by giving it a fixed position in<br />

the following CSS.<br />

index.html: ... ... <br />

The main modal div will act as a container for the rest of the modal content, but<br />

also as a background panel that will cover up the main window content. To<br />

achieve this, we use CSS rules to stretch it to completely cover the viewport by<br />

giving it top, right, bottom, <strong>and</strong> left values of 0. We'll set the z-index to a high<br />

number to ensure the modal is stacked in front of any other element in the page.<br />

Note also that the display is initially set to none, but we're dynamically binding a<br />

class to the modal called show that gives it block display. The addition/removal of<br />

this class will, of course, be bound to the value of modalOpen.<br />

style.css: #modal { display: none; position: fixed; top: 0; right: 0; bottom: 0; left:<br />

0; z-index: 2000; } #modal.show { display: block; }

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!