javascript - How to enable keydown for full document and disable keydown for one div -


i using fancybox form popup , client not want background should scroll

firefox still allow user scroll background via arrow keys.

now blocked user press arrow key till popup complete document, stop same keydown in form also.

is these option user block event document except form ?

try this-

$(document).keydown(function(event){   if ($(event.target).is('.theform'))       event.stoppropogation();   else       // block scrolling   }); 

Comments