Menu icon Foundation

My Posts

  • 3
    Replies
  • Reveal modal activated by time

    By Wilou

    symfony2revealmodals

    Hello everyone i'm trying to use the reveal modal of Foundation. I already succeed in its implementation in my code with docs. However i want it to open up after something like ten seconds. I'm using Foundation with a symfony 2 project. As i'm startin... (continued)

    Last Reply by Wilou over 2 years ago


My Comments

Wilou commented on Wilou's post over 2 years

Finaly i found out why it wasn't functionning i forgot to put :
function modalHandler(delay){
setTimeout(function () {
$('#myModal').foundation('reveal','open');
},delay);
}
added a reveal to foundation('open') and it functionned
However i'm looking for a way to have the modal following the scrolling and for it to stay at he middle of the screen.
The background is grey and i would like to take this of. Just to get the modal.

Wilou commented on Wilou's post over 2 years

Hi i tried to use this but the modal doesn't want to open, i tried with a window load and document redy ready but nether seems to work. But when i put alert in them they show up.
I dont understand what did i do bad.
<div id="myModal" data-overlay="false" class="reveal-modal" data-animate="fade-in fade-out" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog">
<h2 id="modalTitle">Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
<a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
<script>
$(window).load(function() {
alert("window load occurred!");
});
$(document).ready(function() {
alert("Le document est pret")
var $modal = $('#myModal');//define your variables
//var delay = 2000;

            modalHandler();//call your function

            function modalHandler(){
                $('#myModal').foundation('open');

            }

        });

</script>
 
This code is supposed to function no ? or do I need to download a part of foundation to make it work.PS : I'm under ubuntu so i can dowload package

Posts Followed

No Content

Following

    No Content

Followers

My Posts


My Comments

You commented on Wilou's post over 2 years

Finaly i found out why it wasn't functionning i forgot to put :
function modalHandler(delay){
setTimeout(function () {
$('#myModal').foundation('reveal','open');
},delay);
}
added a reveal to foundation('open') and it functionned
However i'm looking for a way to have the modal following the scrolling and for it to stay at he middle of the screen.
The background is grey and i would like to take this of. Just to get the modal.

You commented on Wilou's post over 2 years

Hi i tried to use this but the modal doesn't want to open, i tried with a window load and document redy ready but nether seems to work. But when i put alert in them they show up.
I dont understand what did i do bad.
<div id="myModal" data-overlay="false" class="reveal-modal" data-animate="fade-in fade-out" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog">
<h2 id="modalTitle">Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>I'm a cool paragraph that lives inside of an even cooler modal. Wins!</p>
<a class="close-reveal-modal" aria-label="Close">&#215;</a>
</div>
<script>
$(window).load(function() {
alert("window load occurred!");
});
$(document).ready(function() {
alert("Le document est pret")
var $modal = $('#myModal');//define your variables
//var delay = 2000;

            modalHandler();//call your function

            function modalHandler(){
                $('#myModal').foundation('open');

            }

        });

</script>
 
This code is supposed to function no ? or do I need to download a part of foundation to make it work.PS : I'm under ubuntu so i can dowload package

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content