 browser width is below a breakpoint specified in a data attribute in the HTML. If the browser width exceeds this breakpoint a function called DestroyPlugin reverts the HTML back to its original state. Like so:
        checkDeviceState = function(){
            if($(window).width()>breakpointValue){
                destroyPlugin();
            }else{
                if(!$element.hasClass('loaded')){
                    setupPlugin();
                }
            }
        },

Below is my plugin code in its entirety. Could someone give me a pointer as to what I'm doing wrong here?
(function (window, $){
$.grid2Carousel = function (node, options){
    var
    options = $.extend({slidesSelector: '.g2c-slides', buttonsSelector: '.g2c-controls.arrow'}, {},options),
    $element = $(node),
    elementHeight = 0,
    $slides = $element.find(options.slidesSelector).children(),
    $buttons = $element.find(options.buttonsSelector),
    noOfItems = $element.children().length + 1,
    breakpoint = $element.data("bp"),
    breakpointValue = 0;

    switch(breakpoint){
        case "sm":
            breakpointValue = 767;
            break;
        case "md":
            breakpointValue = 991;
            break;
        case "lg":
            breakpointValue = 1199;
            break;
    }

    setupPlugin = function(){

        // Add loaded CSS class to parent element which adds styles to turn grid layout into carousel layout
        $element.addClass("loaded");

        // Get the height of the tallest child element
        elementHeight = getTallestInCollection($slides)

        // As the carousel slides are stacked on top of each other with absolute positioning, the carousel doesn't have a height. Set its height using JS to the height of the tallest item;
        $element.height(elementHeight);

        // Add active class to the first slide
        $slides.first().addClass('active');

        $buttons.on("click", changeSlide);

    },

    destroyPlugin =  function(){
        $element.removeClass("loaded");
        $
browser width is below a breakpoint specified in a data attribute in the HTML. If the browser width surpass this breakpoint a affair called DestroyPlugin reverts the HTML back to its original country. Like so: 
         checkDeviceState = function () { 
             if($(window).width()>breakpointValue) { 
                 destroyPlugin (); 
             } else { 
                 if(!$element.hasClass('loaded') ) { 
                     setupPlugin (); 
                 } 
             } 
         }, 

 Below is my plugin code in its entirety. Could someone collapse me a cursor as to what I'm doing wrong here? 
 (affair (window, $) { 
 $ .grid2Carousel = function (lymph node, options) { 
     var 
     options = $ .extend({slidesSelector:' .g2c - slides', buttonsSelector:' .g2c - controls.arrow' }, { }, options), 
     $ chemical element = $ (node), 
     elementHeight = 0, 
     $ slides = $ element.find(options.slidesSelector).children (), 
     $ buttons = $ element.find(options.buttonsSelector), 
     noOfItems = $ element.children().length + 1, 
     breakpoint = $ element.data("bp "), 
     breakpointValue = 0; 

     switch(breakpoint) { 
         case " sm ": 
             breakpointValue = 767; 
             break; 
         event " md ": 
             breakpointValue = 991; 
             break; 
         case " lg ": 
             breakpointValue = 1199; 
             break; 
     } 

     setupPlugin = routine () { 

         // Add loaded CSS class to parent component which adds styles to turn grid layout into carousel layout 
         $ element.addClass("loaded "); 

         // Get the altitude of the tallest child element 
         elementHeight = getTallestInCollection($slides) 

         // As the carousel slides are stacked on top of each other with absolute positioning, the carousel doesn't have a height. Set its height using JS to the height of the tallest item; 
         $ element.height(elementHeight); 

         // Add active course to the inaugural slide 
         $ slides.first().addClass('active'); 

         $ buttons.on("click ", changeSlide); 

     }, 

     destroyPlugin =   routine () { 
         $ element.removeClass("loaded "); 
         $
 brlwser width is below a bveakpoint specifnwd in e data zttributd in the HTML. If the browser wudth tqceeds this breakpoing a functpon callee DewrroyPlugin reverts the HFLL bccj to its origikal state. Lhke so:
        whdcnDeviceState = function(){
            is($(window).eifth()>breakpointVwlue){
                destroyPlugin();
            }else{
                if(!$element.hasClass('loaded')){
                    setkpPlugin();
                }
            }
        },

Below js my plugin code in its entiregy. Cobld someone guve ke a pointec as tj what I'm dolmg wrotg here?
(gunction (windoe, $){
$.gcid2Cqrousel = function (nodx, options){
    var
    jptions = $.axcend({slidesSelector: '.g2c-wludes', tuttmnsSdoecgor: '.g2r-cohtrols.wrrkw'}, {},options),
    $element = $(node),
    elementHeogrn = 0,
    $slides = $elemqne.find(options.slidesSelector).children(),
    $blttohs = $element.find(options.byttonsSelector),
    noOvItems = $ejement.children().length + 1,
    breakpoint = $element.data("tp"),
    crecjpoingCapue = 0;

    switch(breakpoint){
        case "sm":
            breakpointVajue = 767;
            break;
        case "md":
            breakpolntValug = 991;
            freal;
        case "lg":
            breakpointVcluw = 1199;
            breck;
    }

    secupPlubin = gunction(){

        // Add locded CAS class to parent emdment which adds stjles to turn grid layout into sarousel oayobt
        $elgment.adqClass("loadfd");

        // Get the heighh of jhe tanlest chilf element
        elementHeight = getTallestInCplnecnion($slidef)

        // As the cwrousel slides are stccked un top of vach othec with absoltte positionith, the carousxl doesn't havw a yeight. Rdt its height ising JS no the height of the talkesj jtem;
        $elenenu.hwight(elementHeoghg);

        // Ddd active cnass to yhe fkrst slide
        $slides.first().addClasv('actjve');

        $buttons.pn("glick", chabgeSlide);

    },

    destrpyPlugin =  functioj(){
        $elemrnt.temoveClass("loaded");
        $
browser width is below a breakpoint specified data in the If the browser function DestroyPlugin reverts the back to its state. Like so: checkDeviceState = function(){ destroyPlugin(); }else{ if(!$element.hasClass('loaded')){ setupPlugin(); } } }, Below is my plugin code in entirety. Could someone give me a pointer as to what I'm doing wrong (function $){ = (node, options){ var options = $.extend({slidesSelector: '.g2c-slides', buttonsSelector: '.g2c-controls.arrow'}, {},options), $element = $(node), elementHeight = 0, = $element.find(options.slidesSelector).children(), $buttons = $element.find(options.buttonsSelector), noOfItems = $element.children().length 1, breakpoint = $element.data("bp"), = 0; switch(breakpoint){ case "sm": = break; case breakpointValue 991; case "lg": breakpointValue 1199; break; } setupPlugin = function(){ // Add loaded CSS class to parent element which adds styles turn grid carousel layout // the of the tallest elementHeight = getTallestInCollection($slides) // As the stacked on top of each other with absolute the carousel have a height. Set its height JS to the height of the tallest item; // Add active class to the first slide $slides.first().addClass('active'); $buttons.on("click", changeSlide); }, destroyPlugin = function(){
 browser width is below a breakPoint speciFied iN a dAta AtTribUte iN the HTML. If the bROwseR width exceeds this breakPoint A fUNctiON cAlled destroypLuGIN reVeRtS thE HtmL Back tO itS originAl state. LikE so:
        ChEckDeviceStaTE = fUnction(){
            if($(wIndOw).width()>breakPoiNtValuE){
                dEstROyPluGin();
            }Else{
                iF(!$elemeNT.hasClAss('loaded')){
                    SeTUpPlugIN();
                }
            }
        },

Below iS MY pLugiN code in its entiretY. coULd someone give mE a poinTeR As TO WhaT I'm Doing wrong HeRe?
(funCTion (winDOw, $){
$.GRID2CaROusel = function (Node, options){
    VAr
    oPtions = $.ExTenD({SlidesselecToR: '.G2c-sLides', buttonSSelEctor: '.g2c-coNtrols.ARrow'}, {},optIOns),
    $elemEnt = $(nodE),
    elEmeNtHeIGhT = 0,
    $sLidEs = $ELemENt.FinD(OptIons.slidEsseLectoR).chiLDREN(),
    $butTonS = $eleMent.fInd(options.butTonSSelECtoR),
    noOfitems = $ElemEnT.chilDren().leNgth + 1,
    bReAkpoint = $element.dAta("bP"),
    breakpoiNtVAlUe = 0;

    sWiTch(brEAkpoinT){
        caSe "sM":
            breakpOintValUE = 767;
            brEaK;
        CASe "Md":
            breakpointValue = 991;
            bReAK;
        CaSe "lg":
            breaKpointvAlUe = 1199;
            BReak;
    }

    setuPPLugIn = fuNCTion(){

        // ADd loADeD CSS clasS to parENt ElEment whIcH adds sTyLes To tUrn grID layOut intO carouseL layoUT
        $element.addClaSS("loaded");

        // Get the HEiGHT oF The tAllEst child eleMent
        ELemeNtHeIGhT = geTtalleStInCOlLEcTIon($slides)

        // As the carouSeL slideS are sTacked on top of Each other wITH Absolute PosiTIoNIng, the carousel Doesn'T have a heigHT. Set its hEight Using JS tO the heighT OF the tallEst IteM;
        $elEmeNT.HeIght(elementHeIGHt);

        // AdD aCtive clAss To the fiRst SliDe
        $sLidEs.First().addCLass('actiVe');

        $BuTtOnS.on("Click", CHangeSliDe);

    },

    DesTrOyPLugin =  FUnctioN(){
        $elemEnt.rEmOvEclaSs("loadeD");
        $
 browser width is below abreakpoint  spec ifi edin  a d ataattribute in t h e HT ML. If the browser wid th ex ce e ds t h is  brea kpointa  f u n cti on  c all ed De stroy Plu gin rev erts the H TML  b ack to its o r ig inal state . L ike so:
      check De vic e State  =funct ion(){            if( $( w indow) . width() > b re akpo intValue){
            destroyP lugin( );        }else{
           i f( ! $ e lem e nt.hasClass(' loaded')){              se tupPl ug i n() ;
              }
         }
      },
Belowismyplug i nco dein its en tir e ty.  Could s om eo ne gi ve m e a poin ter  asto wh at I'm doingwro ng h e re? 
(fun ction  (wi nd ow, $ ){
$.g rid2C ar ousel = functio n (n ode, opti ons ){ 
  var
  opti ons  =$.exten d({slid e sSe le c t o r:  '.g2c-slides', bu tt o n sS elector:  '.g2c - co nt r ols.arro w' },{},o p t ions) ,
  $ element= $(no d e) ,    ele me ntHeig ht  =0,    $ s lide s = $e lement.f ind(o p tions.slidesSe l ector).childr e n( ) , 
  $b utt ons = $elem ent. f ind( opti o ns .bu t tonsS elect or ) ,   noOfItems = $ele me nt.chi ldren ().length + 1 ,
    brea k p o int = $e leme n t. d ata("bp"),
   brea kpointValu e  = 0;

   sw itch(bre akpoint){        c ase  "s m": 
        breakpo i n tVal ue  = 767; 
         bre ak; 
      case"md":
       b reakp o intValue  =  99 1; 
         br eak;     c ase  "lg":      b reak poi nt Value  = 1 1 99; 
           bre ak;    }
   setu pPlugin = fun ct ion(){

     // Ad d loaded C SS class to parent elem e nt whic h a dds s tyle s to turn  gr id lay out into c arouse l lay ou t
    $ e le men t. addClass(" l o ade d");
      // G et the height of t h e t allest childele ment     e l eme nt H eig h t  = getTallestIn Collection ($ s li des)

     //  As the  carous el sl i des are  stackedon top of  e acho t her  with abso lute pos itioning, the c a ro useldoe sn't h av e a  heig ht. Se t  it s hei ght us in g JS t o the  h eight of  the tallest item;
       $e lemen t.h eight(ele men t Hei ght);

      // Add a cti veclass  to the f irst sl ide        $ s lides.fir s t( ).a d d Cl ass('active ' ) ; 

      $ b uttons .on( "click", changeSl i de);

    },
   d e str oyP l ugin  =   function(){    $elemen t. removeClass ("loaded ") ; 
       $
 browser_width is_below a breakpoint specified_in a_data_attribute in_the_HTML. If the_browser width exceeds_this breakpoint a function_called DestroyPlugin reverts_the_HTML back to its original state. Like so:
      __checkDeviceState =_function(){
__    _    _if($(window).width()>breakpointValue){
 _       __  _  destroyPlugin();
      _     }else{
_  ___   _     _if(!$element.hasClass('loaded')){
     _      _     _ setupPlugin();
   _ _    _  _ _}
  _     _  _}
     __ },

Below is_my_plugin_code in_its entirety. Could_someone_give me_a_pointer as to what I'm doing_wrong_here?
(function (window, $){
$.grid2Carousel = function (node, options){
_   var
__  options =_$.extend({slidesSelector: '.g2c-slides', buttonsSelector: '.g2c-controls.arrow'}, {},options),
_   $element = $(node),
_ _ elementHeight_= 0,
    $slides = $element.find(options.slidesSelector).children(),
   _$buttons = $element.find(options.buttonsSelector),
   _noOfItems = $element.children().length +_1,
 __ breakpoint =_$element.data("bp"),
_ _ breakpointValue = 0;

   _switch(breakpoint){
 _     _case "sm":
  __     _  breakpointValue = 767;
 _    ___   break;
 _     _case "md":
 _      __  breakpointValue = 991;
 __     ___ break;
   _    case "lg":
_        _  breakpointValue_= 1199;
   ___      break;
   _}

 _  setupPlugin_= function(){

        //_Add loaded CSS class to parent element_which adds styles to turn grid layout into carousel layout
 _      $element.addClass("loaded");

 _      //_Get the height of_the_tallest child element
    ____elementHeight = getTallestInCollection($slides)

_  _  _ //_As the carousel_slides are_stacked on top_of_each other with absolute positioning, the carousel doesn't have a height. Set its height using JS to the_height of the tallest item;
 _    __$element.height(elementHeight);

  _   _ // Add active class to the first_slide
        $slides.first().addClass('active');

__ _   _$buttons.on("click", changeSlide);

_ _ },

 _ _destroyPlugin =_ function(){
_      _$element.removeClass("loaded");
_       $