0

I've got a modal that i include via jQuery such as:

var vCheckModal = 
    "<div id='myModal' class='custom-modal modal hide fade'>" 
        + "<div class='modal-header'><button type='button' class='close' data-dismiss='modal' aria-hidden='true'>×</button></div>"
        + "<div class='modal-body'><p>Please Upgrade</p></div>"
        + "<div class='modal-footer'><button class='btn' data-dismiss='modal'>Close</button></div>"
    + "</div>";

It then fires upon a browser check:

if (BrowserDetect.browser == "Explorer"){ //If browser is IE
        if (BrowserDetect.version < 10){ //purely for testing
            console.log("less than 10");
            $('body').append(vCheckModal);
            $('#myModal').modal({
                backdrop: true,
                backdrop: 'static',
                show: true
            })
        }
    }

Works fine when I've changed the modal to appear in Firefox and chrome. But in IE 8,9,10 i see not greyed out background. Yet if i visit the twitter bootstrap demo site, i can see the modal's greyed background fine. Although i think this is initialized differently. Can anyone point me in the right direction as to why this is happening?

Boostrap v: 2.3.2

Currently using this detection script

4

1 回答 1

0

在制作 jsFiddle 时,我将问题追溯到我正在使用的引导 CSS 文件。我不确定如何,但它缺少一些 CSS。我更改为正确的版本,现在它在 IE 中运行良好。

于 2013-09-06T08:46:57.823 回答