WP Popups

The most complete WordPress popup builder plugin

  • Features/Addons
  • Pricing
  • Support
  • Docs
  • Login
  • My Account
  • Logout
  • Get WP Popups Now
You are here: Home / Docs / Javascript functions

Javascript functions

WP Popups includes several Javascript functions that can be used to control the popups programmatically. While you can check all the available ones in the window.wppopups object, we are going to list the most useful ones.

wppopups.showPopup(popup_id, force?): This function will let you open a popup programmatically

  • popup_id: The ID of the popup you want to open.
  • force (optional): “force” argument in case you want to force the opening even is one of the cookies is set.

wppopups.hidePopup(popup_id, conversion, time?, cookie?): This function will close the popup but it won’t destroy it, meaning that you could open it again later.

  • popup_id: The ID of the popup you want to close.
  • conversion: Boolean that indicates if you are closing because popup converted or not.
  • time (optional): Milliseconds until the popup it’s finally close. Default to 0.
  • cookie (optional): Boolean that indicates if you want to save cookies or not. Default to true

wppopups.removePopup(popup_id): Close and destroy a popup removing it from the DOM. Popup won’t open again until you refresh the page

  • popup_id: The ID of the popup you want to remove.

wppopups.popupConverted(popup_id): Fires the conversion event and saves a cookie. This is called in hidePopup() but can be launched individually.

  • popup_id: The ID of the popup you want to fire a conversion.

wppopups.popupClosed(popup_id): Fires the closing event and saves a cookie. This is called in hidePopup() but can be launched individually.

  • popup_id: The ID of the popup you want to fire a closing event.

wppopups.togglePopups(show, conversion?): Show or hide all popups in the page.

  • show: Boolean that indicates if the popups will be shown or closed. Default to close
  • conversion (optional): Boolean to indicate if this is a conversion if popup it’s closing. Default to false.

 

Search results

Categories

  • Addons
  • Email Marketing
  • Functionality
  • Getting Started
  • Misc
  • Styling

Need help?

Not finding what you need? We are here to help, please submit a support ticket.

Features

  • 30+ Display rules
  • 45+ Animations
  • A/B Testing
  • Analytics
  • Email Marketing
  • Zapier Addon
  • Multiple Triggers
  • Template Builder
  • Multiple Positions
  • Geolocation
  • Age Verification
  • Idle Logout
  • Leaving Notice
  • AJAX Login/Registration
  • Scheduler Addon

SITE

  • Blog
  • Docs
  • Pricing
  • Affiliates
  • Features
  • Contact
  • Terms & Conditions

Other Products

  • Timersys Plugins
  • GeotargetingWP
  • Facebook Login for WordPress
  • WooCommerce Map Delivery Area
  • WooCommerce Bogo Deals

Linsila LLC © 2023 · Built with Genesis

Before you leave, sign up to our newsletter to receive important updates from our blog and special pormotions!

×

BLACK FRIDAY! Enjoy an extra 20% off discount using coupon code BF2022 on checkout