0
votes

I'm having an issue with the foundation modal, im opening the modal with this function:

function bindAutoRevel() {
  $('div[data-auto-reveal]').foundation('reveal', 'open');
}

but after closing it with the default 'close-reveal-modal' link, it doesn't open again if i click the link that fire the open action. so right now what I have done to solve the problem is this:

$('#create-project-btn').click(function() {
  $('#project-modal').foundation('reveal', 'open');
});

but it should be a way to avoid this. Thanks

1
check the browser console, you may have an error there.ameenulla0007

1 Answers

0
votes

You used it?

Foundation modal

Because last time when I have used foundation modal I didn't have to write any javascript code for opening and closing modal. All my code was:

    <a data-toggle="exampleModal1" class="button large button plus">+</a>

<div class="reveal league-reaveal" id="exampleModal1" data-reveal>
        //some html code
        <button class="close-button success" data-close aria-label="Close reveal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
</div>

This you need to include:

    <script src="~/Scripts/jquery-1.10.2.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/6.0.5/foundation.min.css">
    <script src="https://cdn.jsdelivr.net/foundation/6.0.5/foundation.min.js"></script>
    <script src="jquery.reveal.js" type="text/javascript"></script>

And here is javascript code:

<script type="text/javascript">
        $(document).ready(function () {
        $(document).foundation();
    });
</script>