Post

1 follower Follow
0
Avatar

Can I suppress an ONTRAform pop up for mobile devices?

Frank Hagan

I'm using an ONTRAform lightbox on my website, but I've heard Google is going to start penalizing sites using pop ups on mobile devices. Is there any way I can still use an ONTRAform lightbox form that pops up and just exclude it from mobile devices? 

There's a feature request to have this added to the ONTRAforms by ONTRAPORT here, but I'm wondering if there's an interim solution while that feature request is being considered. 

Answered

Official comment

Avatar

Our developer Jonathan Preston submitted this JavaScript snippet that will suppress the ONTRAform pop up on mobile devices:

<script>
if ( /Android|webOS|iPhone|BlackBerry|IEMobile|Opera Mini/i.test( navigator.userAgent ) ) {
document.styleSheets[0].insertRule( ".OPF__modal-form, .opf__overlay{ display: none !important; }", 0 );
}
</script>

Add this to the "Custom footer code" section on the Settings of your ONTRApage. The JavaScript will suppress any ONTRAform pop ups if the customer is viewing  the site on mobile phone.


Frank Hagan
Comment actions Permalink

Please to leave a comment.

1 comment