How to open MODAL ON SCROLL instead of MODAL ON LOAD

1 reply · opened Apr 30, 2018

RrwebsinghApr 30, 2018

MODAL ON SCROLL instead of MODAL ON LOAD

I want to open POPUP on my home page when start scrolling down and page reaches at some height... i am using this page " modal-onload-common-height.html "

Thanks in Advance

SSemicolon WebSTAFFMay 2, 2018

Hello,

Unfortunately, this is currently not supported by default.

You can consider using the following code:


	jQuery(window).scroll(function (event) {
		var scroll = jQuery(window).scrollTop();
		if( scroll > 600 ) {
			jQuery('#myModal1-trigger').magnificPopup('open');
			jQuery( this ).off( event );
		}
	});

Add the id="myModal1-trigger" to the Anchor with the data-lightbox="inline".

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard