CMP5-Opdracht09

Size
2,065 Kb
Views
36,432

How do I make an cmp5-opdracht09?

What is a cmp5-opdracht09? How do you make a cmp5-opdracht09? This script and codes were developed by Sanne Van Gastel on 30 July 2022, Saturday.

CMP5-Opdracht09 Previews

CMP5-Opdracht09 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CMP5-Opdracht09</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src="js/index.js"></script>
</body>
</html>

CMP5-Opdracht09 - Script Codes CSS Codes

/* het lukte me niet, ik heb verschillende dingen bekeken en geprobeerd, maar zonder uitkomst. Ik heb uiteindelijk deze code gevonden en bestudeerd. Het is vanilla javascript en ik snap hoe het in elkaar steekt. Zou er zelf niet op kunnen komen helaas :( 

CMP5-Opdracht09 - Script Codes JS Codes

var p1 = document.createElement("p"), p2 = document.createElement("p"), btn = document.createElement("button"), hint = document.createElement("h1"), Err = "<h1 style='text-align: center; color: green; font-family: helvetica;'>Mouse has left the window.</h1>";
hint.innerHTML = "over here!";
hint.style.fontFamily = "Helvetica";
hint.style.textAlign = "center";
document.body.style.overflowX = "hidden";
document.body.appendChild(hint);
document.oncontextmenu = function() { alert("nice try ;)"); return false;
}
document.onmousemove = function(e) { hint.style.display = "none"; btn.style.display = "initial"; document.body.appendChild(p1); document.body.appendChild(p2); document.body.appendChild(btn); p1.innerHTML = e.pageX + "x"; p2.innerHTML = e.pageY + "y"; btn.innerHTML = "Try to click me"; btn.style.transform = "translate(" + (e.pageX - 75) + "px," + (e.pageY - 120) + "px)"; btn.onmousedown = function() { alert("you win!"); } document.onmouseleave = function() { btn.style.display = "none"; p1.innerHTML = Err; p2.innerHTML = ""; }
}
CMP5-Opdracht09 - Script Codes
CMP5-Opdracht09 - Script Codes
Home Page Home
Developer Sanne Van Gastel
Username SannevanGastel
Uploaded July 30, 2022
Rating 3
Size 2,065 Kb
Views 36,432
Do you need developer help for CMP5-Opdracht09?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Sanne Van Gastel (SannevanGastel) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!