New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the Community Exchange, where community members ask and answer questions about DNN. To get started, just start typing your question below and either select one of the suggested questions or ask a new question of your own.

DnnModal catch closing event

Return to previous page

  • 1/30/2019
  • 869 Views

Question:

stuart calder 6 years ago

Hi Everyone,

Im using dnnmodal.show as an exit-intent feature, opens fine but im trying to catch the close event when clicking on the x top right in order to write a cookie to stop further displays.

any idea how i would reference that, ive tried below but no luck


$(document).on('mouseleave', leaveFromTop);

function leaveFromTop(e){

if ( e.clientY < 0 )

dnnModal.show('/exitpop.html?popUp=true',true,300,300,false);

};

// handle closing of modal

$('.ui-dialog-titlebar-close .dnnToggleMax .dnnModalCtrl').on('click',function(){

alert("add cookie write");

});


Many thanks


Stu

Sign In to Participate
Or register to become a member