模态不正常?

时间:2014-03-14 22:16:41

标签: html css twitter-bootstrap

我一直在尝试用jQuery编写游戏代码,而且我已经掌握了大部分基础知识。

我目前正在处理html文件,但我发现代码错误,据我所知,没有明显的原因。

有人可以帮忙吗?

我在这里使用bootstrap:http://netdna.bootstrapcdn.com/bootswatch/3.1.1/superhero/bootstrap.min.css

我的代码在这里:

<!-- Modal -->
<div class="modal fade" id="onLoadModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
             <h4 class="modal-title" id="myModalLabel">Welcome to Electronics: Evolution Duo!</h4>

        </div>
        <div class="modal-body">
            <p>You are on your way to become the next big electronics producer, but first you must name your store. How will people know what store to go to if it doesn't have a name?</p>
            <br />
            <p>It would also be wise to put your name on the deed to your store.</p>
             <h3>Name Your Store</h3>

            <input class="form-control" id="store" type="text">
             <h3>Name The Owner:</h3>

            <input class="form-control" id="owner" type="text">
        </div> // error on jsfiddle here
        <div class="modal-footer">
            <button type="button" id="modalClose" class="btn btn-success" data-dismiss="modal">Done</button>
        </div>
    </div> // and an error here
</div> 

我的小提琴在这里:http://jsfiddle.net/boundlessvagabond/cjN4E/6/

1 个答案:

答案 0 :(得分:0)

我添加了这个Java脚本行,它正在为我工​​作

    $('#onLoadModal').modal('show');

您可以查看http://jsbin.com/qobevoya/1/edit?html,js,outputhttp://jsfiddle.net/#&togetherjs=HvliL9wTPc

上的相同示例

PS:你忘了添加一个bootstrap javascript文件