Support » Plugin: Mailbag » Change redirect…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ArrayHQ

    (@okaythemes)

    Hi Stu,
    If the form submits successfully, the URL string gets a sent=1 parameter. You can detect this with JS and then scroll to the anchor where your form is.

    Add this to your theme’s JS and replace #your-anchor with whatever you have your subscribe form wrapped in.

    
    // Scroll to element on div
    if(window.location.href.indexOf("sent=1") > -1) {
    	$('html, body').animate({
            scrollTop: $("#your-anchor").offset().top
        }, 300);
    }
    
    
    edtstu

    (@edtstu)

    I added:

    <script type="text/javascript">
    // Scroll to element on div
    if(window.location.href.indexOf("sent=1") > -1) {
    	$('html, body').animate({
            scrollTop: $("#beta-signup").offset().top
        }, 300);
    }
       </script>

    to header.php

    doesn’t seem to work

    I tried adding just the JS to the main.js but that isn’t working either.

    Website: http://getdistilld.com/
    Theme: Agile-WP

    Plugin Contributor John Parris

    (@mindctrl)

    Member

    Hey Stu,

    Try this in your header (changing the two $ to jQuery):

    <script type="text/javascript">
    if(window.location.href.indexOf("sent=1") > -1) {
    	jQuery('html, body').animate({
            scrollTop: jQuery("#beta-signup").offset().top
        }, 300);
    }
    </script>

    I tested this in my browser dev tool and it seems to work ok. Let us know.

    edtstu

    (@edtstu)

    hmm still not working

    edtstu

    (@edtstu)

    I used a different form plugin that doesn’t refresh and uses ajax instead. Thanks anyway!

    How/where can I edit the actual code of the plugin to add my own redirect URL, instead of the sent=1 parameter?

    (I don’t want it staying on the same page)

    It would be great if a future update of the plugin had “Redirect URL” as an editable field in the plugin options.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change redirect…’ is closed to new replies.