Hello there, is it possible for javascript to lock a mouse when you click on a button or a div? I was doing some google search but I failed to find a script for locking a keyboard or mouse. I just would want to add this feature on my site. Thanks!
jaepi 22 Practically a Master Poster
Recommended Answers
Jump to PostNo. No sane browser / OS setup will let a webpage 'lock the keyboard or mouse'. Think for 30 seconds why this is the case.
If you want to disable all interaction with your site when the user clicks something.. oh-k, something like
document.body.disabled = true/false;
should suffice, although …
Jump to PostMaybe something like this: (untested)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable caching --> <title>Example</title> <style …
All 6 Replies
MattEvans 473 Veteran Poster Team Colleague Featured Poster
jaepi 22 Practically a Master Poster
MattEvans 473 Veteran Poster Team Colleague Featured Poster
jaepi 22 Practically a Master Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
MidiMagic 579 Nearly a Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.