I am currently working on a fun project called Etch-a-Sketch for The Odin Project, and I have a jquery grid that can be redrawn with the click of a button.
Initially, the grid allows the user to choose the size and then draw on it using .mouseenter. However, after clicking the reset button, the drawing functionality seems to break. I'm puzzled as to what might be causing this issue.
To view the project in action, you can check out my jsfiddle here: https://jsfiddle.net/davidtaylorjr/cLcbxmnb/14/
Here is a snippet of the HTML:
<div class="grid_controls">
<button class="clear button">Clear and Redraw</button>
</div>
<div class="container"></div>
And the CSS:
.grid_controls {
text-align: center;
}
.button {
position: absolute;
top: 50%;
}
.box {
margin:0;
border:1px solid lightblue;
box-sizing:border-box;
float:left;
}
.container{
padding:5px;
}
/* Rest of the CSS styling */
Lastly, here is the Javascript part of the project:
$(function(){
// Functions and event handlers
})();