1

I am using ajax call to reveal my modal and then closing it using any of the following three ways:

  1. By clicking on background div

  2. By pressing esc key

  3. By clicking on the close button (X)

And it is working absolutely fine for all three options But when it is opened -> closed -> opened again its not closing by any of the ways it is expected to be closed.

Here is my html code:

<div class="reveal-modal-bg" style="display: block;">
</div>
<div id="trigger-reveal-size-match" class="reveal-modal small open" data-    reveal="" style="display: block; opacity: 1; visibility: visible; top:   50px;">
 <!--
    Couple of divs here
 -->
   <a class="close-reveal-modal cc-icon-x" data-reveal-id="trigger-reveal-size-match"></a>
</div>

and here is my JS code:

$(".close-reveal-modal").on("click touchend", function() {
    var revealId = "#" + $(this).attr("data-reveal-id");
    $(revealId).foundation('reveal', 'close');
});

Anyone out there who knows how to fix this issue please help.

Thanks a lot in advance.

general03
  • 855
  • 1
  • 10
  • 33
00Shunya
  • 85
  • 10
  • I did not heard about Zurb Foundation till now.....still as I see on the web it's front end framework..... what you can see on the console when it did not work? – Akki619 Aug 27 '15 at 05:46
  • Can you take download latest js from Zurb Foundation5 and try again. It seems it was a code fix from another defect that might have caused this problem. – Akki619 Aug 27 '15 at 05:57
  • 1
    @Akki619 there is nothing on the console.I'll try latest js from Zurb Foundation5 and let you know. – 00Shunya Aug 27 '15 at 07:19

0 Answers0