Add div class onclick andstore user choice

Add div class onclick andstore user choice

I thought of giving it a shot myself, it isn't that hard but I'm stuck with a syntax error and probably am not doing the most effect method of achieving the goal.

demo here of what it is like on an other site: 


My fiddle:


To do:

Build cookie function with  https://github.com/carhartl/jquery-cookie that stores the option selected, default is desktop view.

  1. Fix the error in console log for line: $( "#wrap" ).hasClass( "mode" ){
Add an animation fadeIn and FadeOut for when the the onclick event happens. 


how the display of it looks on my work board: