Uncaught TypeError: Cannot read property 'scrollTop' of undefined
<p>I am working on a web page where I need to show a bootstrap modal on changing the value of the select dropdown. </p>

<p>This is the code of change event of select dropdown.</p>

<pre><code>$('#joinb').change(function(){
    switch ($('#joinb')[0].selectedIndex) {
        case 3:
            header_modal = 'Joining Scyon Stria cladding on stud with vertical flashing';
            img_src = "/_mockups/boot_calcs/img/onflash.jpg";
            text_modal = 'This will calculate Stria vertical flashing for all walls greater than 4.2m in length. You can add additional Stria vertical flashing in step 5';
            break;
        case 2:
            header_modal = 'Joining Scyon Stria cladding on stud with sealant';
            img_src = "/_mockups/boot_calcs/img/onsealant.jpg";
            text_modal = 'Boards will be joined on stud with sealant only. No Stria vertical flashing stop will be calculated for this option. This must be calculated in step 5 or select joining board option: On stud vertical flashing option in step 1';
            break;
        case 1:
            header_modal = 'Joining Scyon Stria cladding off stud';
            img_src = "/_mockups/boot_calcs/img/off-stud.jpg";
            text_modal = '';
            break;
    }           
    $('#myModalLabel').html(header_modal);
    $('#modalImg').attr('src',img_src);
    $('#modalText').html(text_modal);
    $('#myModal').modal() //The error occurs at this line.
}); 
</code></pre>

<p>I have included js/bootstrap.min.js and there is another file inside vendor/js/bootstrap.min.js. </p>

<p>Now when I change the value in select option on my HTML page there is some invisible pop-up that pops out and blocks the whole screen. Eventually I am left with no option other than re-loading the page. </p>

<p>When I change the value in select  I encounter <code>Uncaught TypeError: Cannot read property 'scrollTop' of undefined</code> error on web browser console.</p>

<p>I have been working out since two days for solving this issue but I am not able to find where is the 'scrollTop' property and what is causing the problem?</p>

<p>Please help me out of it. I have tried many possibilities but couldn't solve the issue.</p>