Lite Brite .toggle-blink not working


hi there
not sure why the following code is not working correctly for me. it would be a big help if you can find the errors...
the problems seem to be connected to the last section the $(.toggle-blink) because this causes everything else to stop functioning. nothing happens / is active in the browser with this code.
however, if I comment this $(.toggle-blink) function out of the code then the rest works ok.

function main () {
  var colorClass = '';
  $('.select-color').on('click', function() {
    var selectedColor = $(this).attr('class');
    switch (selectedColor) {
      case 'select-color cyan not-selected':
        colorClass = 'cyan';
      case 'select-color yellow not-selected':
        colorClass = 'yellow';
      case 'select-color magenta not-selected':
        colorClass = "magenta";
  $('.box').on('click', function() {
  $('.toggle-blink').on('click', function() {
    if (colorClass) {
      setInterval(function() {
        $('.box.magenta .box.yellow .box.cyan').toggleClass('blink');
      }, 350);



This topic was automatically closed after 7 days. New replies are no longer allowed.