<p dir="auto">If a parent object of the Bootstrap Carousel is hidden using the jQuery .hide() method while the Carousel is in the middle of animating to a new slide, the Carousel will no longer animate when the same parent is unhidden using the jQuery .show() method.</p>
<p dir="auto">This can be duplicated on the Carousel demo page found here: <a href="http://twitter.github.com/bootstrap/javascript.html#carousel">http://twitter.github.com/bootstrap/javascript.html#carousel</a></p>
<p dir="auto">In a debug console on that page, one can hide the Carousel's parent by using the following javascript:<br>
$("section#carousel").hide()</p>
<p dir="auto">and then show it's parent again using this line:<br>
$("section#carousel").show()</p>
<p dir="auto">If the parent is hidden when the demo images are moving between slides, and then shown again later, there is no way to trigger the animations again until the page is reloaded.</p>
<p dir="auto">At a first pass, it looks like this.sliding is never reset back to false unless the animations are able to finish correctly. Hiding the parent seems to cancel the animations without their events triggering a reset of the this.sliding variable.</p>
<p dir="auto">When I tried adding a "reset" that would put this.sliding back to false, it still didn't work. I'm not sure what I'm missing.</p>
<p dir="auto">I have been unable to find a suitable workaround so far.</p>
<p dir="auto">This is only a bug tested in IE 9 and 10. The bug is not produced in Firefox or Chrome. Also note that this bug in ONLY reproduced in modals. This method works for selecting text when not in a modal window.</p>
<p dir="auto">I am programmatically selecting text from a div in a modal. The focus event in Bootstrap <del>2.3.1 on line 907 (shown below)</del> conflicts with the selecting of text.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="enforceFocus: function () {
    var that = this
    $(document).on('focusin.modal', function (e) {
        if (that.$element[0] !== e.target &amp;&amp; !that.$element.has(e.target).length) {
            that.$element.focus()
        }
    })
}"><pre class="notranslate"><code class="notranslate">enforceFocus: function () {
    var that = this
    $(document).on('focusin.modal', function (e) {
        if (that.$element[0] !== e.target &amp;&amp; !that.$element.has(e.target).length) {
            that.$element.focus()
        }
    })
}
</code></pre></div>
<p dir="auto">Below is code to duplicate the issue only in IE.</p>
<p dir="auto">HTML</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;button href=&quot;#myModal&quot; role=&quot;button&quot; class=&quot;btn&quot; data-toggle=&quot;modal&quot;&gt;Show Modal&lt;/button&gt;

&lt;div id=&quot;myModal&quot; class=&quot;modal hide fade&quot; data-backdrop=&quot;false&quot;&gt;
    &lt;div class=&quot;modal-header&quot;&gt;
        &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/button&gt;
        &lt;h3&gt;Modal header&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class=&quot;modal-body&quot;&gt;
        &lt;button class=&quot;btn textSelector&quot;&gt;Select All&lt;/button&gt;
        &lt;div&gt;
            &lt;table class=&quot;table table-bordered table-striped table-condensed&quot;&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Name&lt;/th&gt;
                        &lt;th&gt;Username&lt;/th&gt;
                        &lt;th&gt;Password&lt;/th&gt;
                        &lt;th&gt;Email&lt;/th&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Tuna Child&lt;/td&gt;
                        &lt;td&gt;tchild&lt;/td&gt;
                        &lt;td&gt;t&lt;/td&gt;
                        &lt;td&gt;tuna@tuna.com&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Joshua Hazengoa&lt;/td&gt;
                        &lt;td&gt;jhazengoa&lt;/td&gt;
                        &lt;td&gt;jj32&lt;/td&gt;
                        &lt;td&gt;josh@tunaeater.com&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;modal-footer&quot;&gt;
        &lt;button class=&quot;btn btn-primary&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
    &lt;/div&gt;
&lt;/div&gt;"><pre class="notranslate"><code class="notranslate">&lt;button href="#myModal" role="button" class="btn" data-toggle="modal"&gt;Show Modal&lt;/button&gt;

&lt;div id="myModal" class="modal hide fade" data-backdrop="false"&gt;
    &lt;div class="modal-header"&gt;
        &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
        &lt;h3&gt;Modal header&lt;/h3&gt;
    &lt;/div&gt;
    &lt;div class="modal-body"&gt;
        &lt;button class="btn textSelector"&gt;Select All&lt;/button&gt;
        &lt;div&gt;
            &lt;table class="table table-bordered table-striped table-condensed"&gt;
                &lt;thead&gt;
                    &lt;tr&gt;
                        &lt;th&gt;Name&lt;/th&gt;
                        &lt;th&gt;Username&lt;/th&gt;
                        &lt;th&gt;Password&lt;/th&gt;
                        &lt;th&gt;Email&lt;/th&gt;
                    &lt;/tr&gt;
                &lt;/thead&gt;
                &lt;tbody&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Tuna Child&lt;/td&gt;
                        &lt;td&gt;tchild&lt;/td&gt;
                        &lt;td&gt;t&lt;/td&gt;
                        &lt;td&gt;tuna@tuna.com&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;Joshua Hazengoa&lt;/td&gt;
                        &lt;td&gt;jhazengoa&lt;/td&gt;
                        &lt;td&gt;jj32&lt;/td&gt;
                        &lt;td&gt;josh@tunaeater.com&lt;/td&gt;
                    &lt;/tr&gt;
                &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="modal-footer"&gt;
        &lt;button class="btn btn-primary" data-dismiss="modal"&gt;Close&lt;/button&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre></div>
<p dir="auto">The JavaScript to simulate selecting the text:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$('.textSelector').click(function(){
    var text = $(this).siblings().find(&quot;table&quot;).parent()[0];
    var range;
    if(document.body.createTextRange){ //ms
        range = document.body.createTextRange();
        range.moveToElementText(text);
        range.select();
    }else if(window.getSelection){ //all others
        var selection = window.getSelection();
        range = document.createRange();
        range.selectNodeContents(text);
        selection.removeAllRanges();
        selection.addRange(range);
    }
});"><pre class="notranslate"><code class="notranslate">$('.textSelector').click(function(){
    var text = $(this).siblings().find("table").parent()[0];
    var range;
    if(document.body.createTextRange){ //ms
        range = document.body.createTextRange();
        range.moveToElementText(text);
        range.select();
    }else if(window.getSelection){ //all others
        var selection = window.getSelection();
        range = document.createRange();
        range.selectNodeContents(text);
        selection.removeAllRanges();
        selection.addRange(range);
    }
});
</code></pre></div>
<p dir="auto">I have isolated the issue in the bootstrap source on line 907 (as mentioned above) and have added a bandage fix to my code above, at the top of the click event:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$(document).off(&quot;focusin.modal&quot;);"><pre class="notranslate"><code class="notranslate">$(document).off("focusin.modal");
</code></pre></div>