Skip to content

Commit

Permalink
switch to addEventListener
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanrhu committed Feb 12, 2019
1 parent 635f574 commit 5e09053
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<div class="mainBox">
<div style="font-size: 25px; margin-bottom: 5px; margin-top: 10px; position: relative; display: inline-block; margin-bottom: 10px;">
nodes.js
<div style="font-size: 13px; position: absolute; right: -30px; top: 0px; display: inline-block; color: #9f9f9f;">v1.1</div>
<div style="font-size: 13px; position: absolute; right: -30px; top: 0px; display: inline-block; color: #9f9f9f;">v1.2</div>
</div>
<div style="font-size: 13px; margin-bottom: 5px;">
HTML5 Canvas nodes/particles animation with Javascript
Expand Down
5 changes: 3 additions & 2 deletions js/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ var NodesJs = (function (parameters) {
}
};

document.body.onload = function () {
window[window.addEventListener ? 'addEventListener': 'attachEvent']
(window.addEventListener ? 'load': 'onload', function () {
canvas = document.getElementById(t_NodesJs.id);
ctx = canvas.getContext('2d');

Expand Down Expand Up @@ -135,5 +136,5 @@ var NodesJs = (function (parameters) {
};

step();
};
});
});

0 comments on commit 5e09053

Please sign in to comment.