jQuery Popup Window – modalPopLite V1.3.1


Latest release of jQuery modalPopLite. Super simple jquery modal popup window.

V1.3.1 adds the ability to provide a callback function to execute code when the user closes the popup.

Instructions and download here:

You can see it in use on the home page here (more info buttons on products under the banner):

Also on the product pages for playing back videos:

  • http://www.webmentor.cr/ Marco Berrocal

    Love it!! But need it on page load. Do you think you can help me with this???

    • Simon

      Hi Marco,

      Yes that is simple to do. Just trigger the button that would normally open it. If you dont want the button visible then hide it with css.

      In your html:

      In your css;
      #hide-btn{display:none;}

      • http://www.webmentor.cr/ Marco Berrocal

        Beautiful mate!!! Just one more question hope I am not bugging too much. I am being asked if they close it and they return to the page that serves it, not to load it.

        I am thinking of using either PHP as a flag variable to know the page has been loaded once (sessions or cookies, I don’t know) or use it in jQuery instead. Which one would you go with?

        • Simon

          Hi Marco, no problem. Use cookies – they persist for as long as you want so when the user comes back it will still not show if the cookie has been set. Sessions only last generally while the user is actually on the site and will be destroyed not long after depending on your settings. Cookies are little files stored on the client machine, sessions are variables usually stored in server memory.
          Simon.

  • http://www.atomicreach.com Annette

    Hi Simon,

    I am working with a brand to build an engaging content community that covers topics relating to tech news, software, API and mobile apps development.

    We’ve taken a read through your blog and we think you’ve done a fantastic job covering topics that our brand’s audience would also be interested in covering. It would be great if you could join our community to help educate, inform and converse with those in the tech industry.

    If you would like to learn more about this, please send an email to info@atomicreach.com

    Thanks,
    Annette

  • http://www.webmentor.cr/ Marco Berrocal

    Yah I think PHP is far easier. Just and if-else on the script and content if the cookie is set. Thanks, this script saved my life :D!!

  • Tom

    Hi Simon. I seem to be missing something…otherwise I don’t know what’s wrong. I tried your example, and modified so that it loads on page load but it doesn’t trigger the popup…

    $(document).ready(function () {
    $(‘#clicker’).trigger(‘click’);
    });
    $(function () {
    $(‘#popup-wrapper’).modalPopLite({openButton:’#clicker’,closeButton:’#close-btn’, isModal: true });
    });

    • Simon

      Hi Tom,

      The maybe put all the code in the doc ready.

      $(document).ready(function () {

      $(‘#popup-wrapper’).modalPopLite({openButton:’#clicker’,closeButton:’#close-btn’, isModal: true });
      $(‘#clicker’).trigger(‘click’);
      });

      Have you checked the popup opens by manually clicking the button first?