Foundation Modals
A modal is a popup displayed at the top of the page.
We can, on a container element (such as If you want to close the modal by clicking on an area outside the modal. You can add it to the modal's close button Note: The slider requires JavaScript. So you need to initialize Foundation JS: Click To Open Modal Heading in Modal. Some text in the modal. Some text in the modal. $(document).ready(function() { $(document).foundation(); }) < /script Try it » You can add the following classes to the modal container to set the size of the modal: Note: Defaults to 80% width on tablets, laptops, and PCs, and 100% width on small-screen devices. "reveal-modal tiny|small|medium|large|xlarge|full" data-reveal Try it » You can embed a modal within a modal by adding a new trigger button on the first modal. You must set a unique id for the embedded modal: Click To Open Modal First Modal Some text.. Open Second Modal Tada! Second Modal Some text.. Try it » The second modal will replace the first modal. If you want to keep the first modal open when opening the second modal, you can add on the second modal data-reveal data-options= "multiple_opened:true;" Try it ».reveal-modal class and data-reveal attribute to add a modal. You can use the data-reveal-id="id" attribute to open the modal. id must match the container id (in this example "myModal").
Add on the tag .close-reveal-modal class.Example
<
button
type=
"button"
class=
"button"
data-reveal-id=
"myModal"<
/button
<
div
id=
"myModal"
class=
"reveal-modal"
data-reveal
<
h2<
/h2
<
p<
/p
<
p<
/p
<
a
class=
"close-reveal-modal"
×
<
/a
<
/div
<
script
Modal Size
.tiny: 30% width.small: 40% width.medium: 60% width.large: 70% width.xlarge: 95% width.full: 100% width and heightExample
<
div
id=
"myModal"
class=
Embedded modal
Example
<
a
href=
"#"
class=
"button"
data-reveal-id=
"myModal"<
/a
<
div
id=
"myModal"
class=
"reveal-modal"
data-reveal
<
h2<
/h2
<
p<
/p
<
p
<
a
href=
"#"
data-reveal-id=
"secondModal"
class=
"button"<
/a
<
/p
<
a
class=
"close-reveal-modal"
×
<
/a
<
/div
<
div
id=
"secondModal"
class=
"reveal-modal"
data-reveal
<
h2<
/h2
<
p<
/p
<
a
class=
"close-reveal-modal"
×
<
/a
<
/divdata-options="multiple_opened:true;" property through the following steps:Example
<
div
id=
"secondModal"
class=
"reveal-modal"