jQuery addClass example

Change class name on click in jQuery

HTML

<script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
<script src="https://code.createjs.com/easeljs-0.8.2.min.js"></script>
<div style="background: #FFFFFF; position: absolute; z-index: 0; width: 100%; height: 100%;"><canvas id="wires" style="position: absolute; z-index: -1; width: 100%; height: 100%;"></canvas></div>

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#banner-message {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  font-size: 25px;
  text-align: center;
  transition: all 0.2s;
  margin: 0 auto;
  width: 300px;
}

button {
  background: #0084ff;
  border: none;
  border-radius: 5px;
  padding: 8px 14px;
  font-size: 15px;
  color: #fff;
}

#banner-message.alt {
  background: #0084ff;
  color: #fff;
  margin-top: 40px;
  width: 200px;
}

#banner-message.alt button {
  background: #fff;
  color: #000;
}

JavaScript

var color = createjs.Graphics.getRGB(0x804040, 1);
var stage;
$(function() {
  stage = new createjs.Stage("wires");
  var wire, graphics, point;

  wire = new createjs.Shape();
  graphics = wire.graphics;
  graphics.setStrokeStyle(0.25);
  graphics.beginStroke(color);
  point = {
    top: 1377.5,
    left: 208.640625
  };
  graphics.moveTo(point.left / 5, point.top / 5);
  point = {
    top: 577.5,
    left: 520
  };
  graphics.lineTo(point.left / 5, point.top / 5);
  graphics.endStroke();
  stage.addChild(wire);

  wire = new createjs.Shape();
  graphics = wire.graphics;
  graphics.setStrokeStyle(0.25);
  graphics.beginStroke(color);
  point = {
    top: 1377.5,
    left: 208.640625
  };
  graphics.moveTo(point.lef / 5, point.top / 5);

  point = {
    top: 545.5,
    left: 520
  };
  graphics.lineTo(point.left / 5, point.top / 5);
  graphics.endStroke();
  stage.addChild(wire);

  wire = new createjs.Shape();
  graphics = wire.graphics;
  graphics.setStrokeStyle(0.25);
  graphics.beginStroke(color);
  point = {
    top: 1377.5,
    left: 208.640625
  };
  graphics.moveTo(point.left / 5, point.top / 5);
  point = {
    top: 513.5,
    left: 520
  };
  graphics.lineTo(point.left / 5, point.top / 5);
  graphics.endStroke();
  stage.addChild(wire);

  stage.update();
});