Okay, so I have a div
that pops up when it is opened. When the div
is open (showing) when you click anywhere in the window that ISN'T the div
itself, it closes the div
. When I click IN the pop out div it stays open - as should) All that works...
However when I RIGHT-CLICK inside the div, JQuery
treats it as if it was a click outside of the div and closes it --> I don't want this to happen. I want it to stay open the same way it does when you left click inside of it.
Here is the code.
NOTE: THIS CODE IS WORKING. HOWEVER I NEED TO ADD SOMETHING TO STOP THE ISSUE STATED ABOVE.
$(document).ready(function(){
$("#showpopup").click(function( e ) {
e.stopPropagation();
document.body.style.overflow = 'hidden';
$("#mainpopout").show();
});
$("#actualpopout").on('click',function( e ){
e.stopPropagation();
});
$(document).on('click', function( e ) {
if( e.target.id != 'actualpopout' ){
$("#mainpopout").hide();
document.body.style.overflowY = 'scroll';
}
});
});