This is my popup it show first time click only

How to achieve this?

<a href="#downloadme" class="fancyBoxLink">Value</a>
<div style="display:none">
    <div id="downloadme">
    <h1>Please fill following information to download files</h1>
        <form action="<?php echo $this->getUrl('downloadenquire/index/downloadme') ?>" method="post" id="download">
            <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />
                <input type="text" name="name" placeholder="Name" required="true" class="input-text required-entry validate-alpha" />
                <input type="text" name="email" placeholder="Email" required="true" class="input-text required-entry validate-email"/>
                <input type="text" name="mobile" placeholder="Mobile" required="true" class="input-text required-entry validate-number"/>
            <input type="submit" value="Submit" id="submit-download" />

<script type="text/javascript">
jQuery(document).ready(function($) {
        'href'   : '#downloadme',
        'titleShow'  : false,
        'transitionIn'  : 'elastic',
        'transitionOut' : 'elastic',
        'openEffect'    : 'elastic',
        'closeEffect'   : 'elastic',
        'maxWidth'  : 800,
        'maxHeight' : 600,
        'fitToView' : false,
        'width'     : '35%',
        'height'    : '38%',
        'autoSize'  : false,
        'closeClick'    : false
    }); });

<script type="text/javascript">
    //< ![CDATA[
        var customForm = new VarienForm('download');

2 Answers 2


I save the cookie for popup with this function

_setCookie: function () {
        var expDate = new Date();

        expDate.setTime(expDate.getTime() + 3650000 * 60 * 1000);
        $.cookie('popup_cookie', 1, {
            expires: expDate

With if statement checking if cookie exsists and if exsists I don't show popup. I call this function when closed:function() runs or when success:function() runs I don't know you need it exactly or not, hope it ll help you.


I have another solution for your quick session cookie help: create one file in block:


Class Namespace_Module_Block_Popup extends Mage_Core_Block_Template {
public function __construct() {
    if (!$this->helper('customer')->isLoggedIn() && empty($cookie)){            

After creating this block create template in


add below html code:

<div class="second-column" id="loginpage" style="display:none;">
    <div class="popoup_sidebar">

        <div class="popup_sidebar2">
           <span>Your popup</span>

add this fancybox script:

<script type="text/javascript">
    jQuery(document).ready(function () {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.