• Resolved Dave Bergschneider

    (@dave-bergschneider)


    Hi,

    First this is a great plugin.

    I have a custom form that I built and I’m trying to invoke a pop-up on successful validation to confirm their selection. I know you can invoke the popup with a css class but I’m trying to invoke a specific popup with JavaScript. Is there a standard function I can use?

    https://wordpress.org/plugins/popup-maker/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    Great Questions. Although not documented and never asked for there is a fully functional standalone jQuery plugin written behind the scenes. the .popmake() function has many methods and options.

    Everything was built to be extended, custom/extra animations, extended themeing, even our analytics hooks in via events to the open and close of a popup.

    That said here are the basics which I will put as the start of a documentation.

    General Information: Each popup is initialized separately already during page load. The following methods are used by using the popups id for the selector. All examples use ID #1.

    Methods

    Open a popup, with optional callback function:

    jQuery('#popmake-1').popmake('open', callback);

    Close a popup:

    jQuery('#popmake-1').popmake('close');

    Reposition a popup to its starting location in the window, with optional callback function:

    jQuery('#popmake-1').popmake('reposition', callback);

    Retheme a popup, with optional theme argument override.

    jQuery('#popmake-1').popmake('retheme', theme);

    Animate a popup with style and optional callback:

    jQuery('#popmake-1').popmake('animate', style, callback);

    Access Settings

    settings = jQuery('#popmake-1').data('popmake'); // Or if in one of our events you can use this.data('popmake');
    // All admin settings are stored in the meta key.
    settings.id; // The id of the popup. Useful for checking if a certain popup is loading to attach settings.
    settings.meta.close; // Contains all the close settings.
    settings.meta.display // Contains all display settings.
    
    settings.meta.close.esc_press; // Whether Esc Press is checked on Close Options
    settings.meta.display.size; // The selected size.

    Events

    popmakeInit: Runs when the popups are first initilized. Useful for checking settings and adding extra functionality, runs just after document.ready
    popmakeBeforeOpen: Runs just before the popup is shown.
    popmakeAfterOpen: Runs just after the popup is shown.
    popmakeBeforeClose: Runs just before the popup is closed.
    popmakeAfterClose: Runs just after the popup is closed.
    popmakeBeforeReposition: Runs before re positioning the popup. Useful to change the position settings before it is moved.
    popmakeBeforeRetheme: ARuns before re theming. Useful to change theme settings.
    popmakeAfterRetheme: Accepts argument theme which contains all theme settings. Runs after core theme. Useful for extra theme settings.

    The Full code is very readable and accessible on GitHub. Fully built to be extended.
    https://github.com/danieliser/Popup-Maker/blob/master/assets/scripts/popup-maker-site.js

    Thread Starter Dave Bergschneider

    (@dave-bergschneider)

    That’s exactly what I was looking for. Thank you very much.

    Thread Starter Dave Bergschneider

    (@dave-bergschneider)

    Setting as resolved.

    Plugin Author Daniel Iser

    (@danieliser)

    Just added this to our sites docs. Popup Maker javascript API

    This plugin is built to be extended or stripped down any way you want. We are even opening our market for other developers to make and sell extensions as well.

    Also please take a moment to rate and review the plugin and or support.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘JavaScript Trigger’ is closed to new replies.