Support

Home Forums Custom Files Add-on (EE3) Auto scrolling for Payment form

Auto scrolling for Payment form

Posted: October 11, 2013 at 5:44 am


IPES

October 11, 2013 at 5:44 am

Is it possible that when a payment method is clicked, can the page auto-scroll to the payment form ? If so, could you give me some idea to how this might be done? Thanks ๐Ÿ™‚


Dean

October 11, 2013 at 6:43 am

Using PayPal Pro and this as an example http://stackoverflow.com/questions/6677035/jquery-scroll-to-element

jQuery("#paypal_pro-payment-option-lnk").click(function() {
    jQuery('html, body').animate({
        scrollTop: jQuery("#paypal-billing-info-dv").offset().top
    }, 2000);
});

You would need to add it into the gateway_display.php. You will probably need to play around with the code as it was only partially working in my quick test, but it should be enough to get you started.


IPES

October 11, 2013 at 7:38 am

Thanks I’ll give it a shot!


Dean

October 14, 2013 at 12:56 am

No problem, good luck.

The support post ‘Auto scrolling for Payment form’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso