0

I am using window.js to show a popup. In pop up i used a phtml file

    <div class="hb-giveReview" id="custompopup">
      <a onclick="return showForm('signup_popup_form')" href="#">
       <button class="reviewBtn">Write a Review</button>
      </a> 
   </div>

Inside a div, I called phtml file

<div id="signup_popup_form" style="display: none;" >
<?php  echo  $this->getLayout()->createBlock('core/template')
    ->setTemplate('instagramapi/signupform.phtml')->toHtml();?>
</div>

I want to run a function when user click on close button

<script type="text/javascript">
function showForm(id){
    document.getElementById('popup').style.display = "block";
win = new Window({ id:'popup_window', className: "magento", title: "Sign Up Form", zIndex:3000, destroyOnClose: true, recenterAuto:true, resizable: true, width:450, height:473, minimizable: false, maximizable: false, draggable: true});
win.setContent(id, false, false);
win.showCenter();
}
$(document).on('click', '.magento_close', function() {
     alert('letsclose');
})
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.