"Change Background Color on Mousemove"
Bootstrap 4.0.0 Snippet by aaqib33

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <section></section> <script src="https://code.jquery.com/jquery-3.3.1.js"></script> <script> $("section").mousemove(function(){ var val1 = event.pageX/2; var val2 = event.pageY/2; var rgbColor = "rgb(" + val1 + "," + val2 + ",00)"; $("section").css("background-color",rgbColor); }); </script>
body{ margin:0; padding:0; } section { width:100%; height:100vh; background-color:#000; transition:.5s; }

Related: See More


Questions / Comments: