68.gif

Search (advanced search)
Use this Search form before posting, asking or make a new thread.
Tips: Use Quotation mark to search words (eg. "How To Make Money Online")

05-31-2014, 02:42 AM (This post was last modified: 05-31-2014 02:55 AM by leo1in88.)
Post: #1
how can i create a exit popup like this in WORDPRESS?
I see many sites using this pop up, and how can i create it in Wordpress?
Thank you so much.

http://upanh.biz/images/2014/05/30/exit_popup.png

Plz anyone help me :(
05-31-2014, 03:18 AM
Post: #2
RE:
google exit popup plugins or try this one: https://wordpress.org/plugins/m-wp-popup/ - i haven't tried it yet but will later. also, there is another one i used to use when i have time later i will look for it for you.
05-31-2014, 03:21 AM
Post: #3
RE:
(05-31-2014 03:18 AM)supergirl Wrote:  google exit popup plugins or try this one: https://wordpress.org/plugins/m-wp-popup/ - i haven't tried it yet but will later. also, there is another one i used to use when i have time later i will look for it for you.
Thank you supergirl,
I think it's just a javascript added to somewhere in WP function.
05-31-2014, 04:09 AM
Post: #4
RE:
1- create js file and put it to js folder and add this code to it
myjsfile.js

PHP Code:
window.onbeforeunload = function(){  return 'Are you sure you want to leave?';}; 


2- add this codes to functions.php
PHP Code:
function my_scripts_method() {    wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 
05-31-2014, 01:08 PM
Post: #5
RE:
(05-31-2014 04:09 AM)8888post Wrote:  1- create js file and put it to js folder and add this code to it
myjsfile.js

PHP Code:
window.onbeforeunload = function(){  return 'Are you sure you want to leave?';}; 


2- add this codes to functions.php
PHP Code:
function my_scripts_method() {    wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 
Thank you so much, but how can i redirect someone to another when he wants to stay, maybe a bonus page or optin page?
34.gif
05-31-2014, 05:45 PM
Post: #6
RE:
(05-31-2014 01:08 PM)leo1in88 Wrote:  
(05-31-2014 04:09 AM)8888post Wrote:  1- create js file and put it to js folder and add this code to it
myjsfile.js

PHP Code:
window.onbeforeunload = function(){  return 'Are you sure you want to leave?';}; 


2- add this codes to functions.php
PHP Code:
function my_scripts_method() {    wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 
Thank you so much, but how can i redirect someone to another when he wants to stay, maybe a bonus page or optin page?


above code useful for one page themes.
but if you need warn user on exit site or click external link (not internal links) use this codes
myjsfile.js
PHP Code:
window.onbeforeunload = function(){    return "Are you sure you want to leave our website?";}$(function(){    $('a').click(function(){        if (this.href.match(location.host)) {            //alert('Please continue on to our site.');            window.onbeforeunload = null;        } else {            //alert('You are about to leave our website.');        }    }); }); 
functions.php
PHP Code:
if (!is_admin()) add_action("wp_enqueue_scripts""my_jquery_enqueue"11);function my_jquery_enqueue() {   wp_deregister_script('jquery');   wp_register_script('jquery'"http" . ($_SERVER['SERVER_PORT'] == 443 "s" "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"falsenull);   wp_enqueue_script('jquery');   wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 

05-31-2014, 06:04 PM
Post: #7
RE:
Hi Dear, you can check this one https://wordpress.org/plugins/pinoy-pop-...reenshots/
06-01-2014, 12:52 AM
Post: #8
RE:
(05-31-2014 06:04 PM)sharesolutions Wrote:  Hi Dear, you can check this one https://wordpress.org/plugins/pinoy-pop-...reenshots/
Thank you, but seem this plugin has Last Updated: 2011-9-13, does it still work?
06-01-2014, 01:08 AM
Post: #9
RE:
(05-31-2014 05:45 PM)8888post Wrote:  
(05-31-2014 01:08 PM)leo1in88 Wrote:  
(05-31-2014 04:09 AM)8888post Wrote:  1- create js file and put it to js folder and add this code to it
myjsfile.js

PHP Code:
window.onbeforeunload = function(){  return 'Are you sure you want to leave?';}; 


2- add this codes to functions.php
PHP Code:
function my_scripts_method() {    wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 
Thank you so much, but how can i redirect someone to another when he wants to stay, maybe a bonus page or optin page?


above code useful for one page themes.
but if you need warn user on exit site or click external link (not internal links) use this codes
myjsfile.js
PHP Code:
window.onbeforeunload = function(){    return "Are you sure you want to leave our website?";}$(function(){    $('a').click(function(){        if (this.href.match(location.host)) {            //alert('Please continue on to our site.');            window.onbeforeunload = null;        } else {            //alert('You are about to leave our website.');        }    }); }); 
functions.php
PHP Code:
if (!is_admin()) add_action("wp_enqueue_scripts""my_jquery_enqueue"11);function my_jquery_enqueue() {   wp_deregister_script('jquery');   wp_register_script('jquery'"http" . ($_SERVER['SERVER_PORT'] == 443 "s" "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"falsenull);   wp_enqueue_script('jquery');   wp_enqueue_script(        'custom-script',        get_stylesheet_directory_uri() . '/js/myjsfile.js',        array( 'jquery' )    );} 

Thank , but where i insert the next page, once the customer stay on the page?
06-01-2014, 02:11 AM
Post: #10
RE:
(06-01-2014 01:08 AM)leo1in88 Wrote:  Thank , but where i insert the next page, once the customer stay on the page?
create all page in dashboard and for next botton that liked to next page.
44.gif




23.gif