How to implement javascript to the theme Bootstrap Please help me figure out what I'm doing wrong. I spent a lot of time to search for solutions, but could not find it.
I am trying to add functionality Demo in the sub-theme Bootstrap.
Added script to theme subtheme/js/script.js

(function ($, Drupal, window, document, undefined) {
    $(document).ready(function(){
        $(".b-left-side__pointer").click(function(){
           if ($(".switch").hasClass('b-container__left-side')) {
                $(".switch").removeClass('b-container__left-side').addClass('b-container-block-left');
            } else {$(".switch").removeClass('b-container-block-left').addClass('b-container__left-side');
                }        
        });
    });
})(jQuery, Drupal, this, this.document);


Added styles to theme subtheme/css/subtheme_style.css

.b-container__left-side {
  position: absolute;
  top: 52px;
  left: -300px;
  height: calc(100% - 52px);
  height: -moz-calc(100% - 52px);
  width: 300px;
  z-index: 1006;
  display: block;
  -webkit-transition-duration: 0.8s;
  -moz-transition-duration: 0.8s;
  -o-transition-duration: 0.8s;
  transition-duration: 0.8s;
}

.b-container-block-left {
  width: 300px;
  float: left;
  height: 97vh;
  margin-top: 0;
  border: none;
  background: #fff;
}

.b-left-side {
  height: 100%;
  overflow: auto;
}

.b-left-side__pointer:hover {
  cursor: pointer;
}

.b-left-side__pointer {
  position: absolute;
  bottom: 20px;
  left: 300px;
  width: 25px;
  height: 90px;
  border-bottom-right-radius: 3px;
  border-top-right-radius: 3px;
  background-color: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  z-index: -1;
}

.b-left-side__pointer p {
  transform: rotate(-90deg);
  transform-origin: left top 0;
  -webkit-transform: rotate(-90deg);
  -webkit-transform-origin: left top 0;
  margin: 80px 0 0 0;
  font-family: WWF;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}


Added to the end of the subtheme file  subtheme/templates/page.tpl.php (the file is copied from a folder of Bootstrap theme themes/bootstrap/templates/system/page.tpl.php)

&lt;?php if (!empty($page['l_sidebar'])): ?&gt;&lt;!-- /#Left sidebar --&gt;
    &lt;div class="switch b-container__left-side"&gt;
      &lt;div class="b-left-side"&gt;
        &lt;?php print render($page['l_sidebar']); ?&gt;
      &lt;/div&gt;
      &lt;div id="b-left-side__pointer" class="b-left-side__pointer"&gt;
        &lt;p&gt;Block&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;?php endif; ?&gt;


Add to subthemes info file the following lines:

regions[l_sidebar] = 'Left sidebar'
stylesheets[all][] = css/subtheme_style.css
scripts[] = js/script.js


The subject area  "Block" appeared but it does not respond on clicking.
Please set z-index to solve it.

.b-left-side__pointer {
  z-index: 1;
}


Also, I have some advices for your code.


make use of Drupal behaviors instead of $(document).read()
use jQuery.once() to prevent event binding multiple times, it would happen if your page contains ajax.
use jQuery.toggleClass() to simplify the complexity of logic.


(function ($, Drupal, window, document, undefined) {
    Drupal.behaviors.sub_theme = {
        attach: function(context, settings) {
            $(".b-container__left-side", context).once('b-left-side', function() {
                $(".b-left-side__pointer", this).click(function(){
                    $(this).toggleClass('show');
                });
            });
        }
    }

})(jQuery, Drupal, this, this.document);


You need to change your CSS and also class name on HTML. I can't give opinion with that due to lack of information of your requirement.