ボタンのクリックごとに異なるフォームをポップしたい。そのためにこのコードを使用しています。ただし、すべてのボタンをクリックすると、最初のコンテンツフォームが表示されます。どのように解決しますか?コード
<a href="#" class="button">Click 1</a>
<div id="modal">
<div id="heading">Content form 1</div>
</div>
<a href="#" class="button">Click 2</a>
<div id="modal">
<div id="heading">Content form 2</div>
</div>
<!--jQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="js/jquery.reveal.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.button').click(function (e) { // Button which will activate our modal
$('#modal').reveal({ // The item which will be opened with reveal
animation: 'fade', // fade, fadeAndPop, none
animationspeed: 600, // how fast animtions are
closeonbackgroundclick: true, // if you click background will modal close?
dismissmodalclass: 'close' // the class of a button or element that will close an open modal
});
return false;
});
});
</script>