Skip to content

Instantly share code, notes, and snippets.

@kyleturman
Created March 5, 2017 23:21
Show Gist options
  • Save kyleturman/f1eb9b2cf067b1577b0a0df779a6ffac to your computer and use it in GitHub Desktop.
Save kyleturman/f1eb9b2cf067b1577b0a0df779a6ffac to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=f1eb9b2cf067b1577b0a0df779a6ffac
<!DOCTYPE html>
<html>
<head>
<title>Spot the Bug - March 6th</title>
</head>
<body>
<div class='hero'>
<h1>Hello there!</h1>
</div>
<div>
<h1>Welcome to my website</h1>
<p>Fix the bug in the JavaScript for a surprise.</p>
</div>
</body>
</html>
{"enabledLibraries":["jquery"]}
function changeBackgroundColor(className, color) {
$(className).css('background-color', color);
}
$(document).ready(function() {
setTimeout(function(){
// Changes the background color of hero to blue
changeBackgroundColor('blue', '.hero');
}, 750);
});
/* Ignore - no bug here */
body {
text-align: center;
margin: 0;
}
.hero {
background-color: white;
color: white;
height: 300px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease-out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment