Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. //this is a sample flashlight effect
  2.  
  3. $(document).ready(function() {
  4. $(this).mousemove(function(e) {
  5. $("#light").css({
  6. "top": e.pageY - 250,
  7. "left": e.pageX - 250
  8. })
  9. }).mousedown(function(e) {
  10. switch (e.which) {
  11. case 1:
  12. $("#light").toggleClass("light-off");
  13. break;
  14. case 2:
  15. console.log('Middle Mouse button pressed.');
  16. break;
  17. case 3:
  18. console.log('Right Mouse button pressed.');
  19. break;
  20. default:
  21. console.log('You have a strange Mouse!');
  22. }
  23. })
  24. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement