我爱编程

bootstrap弹出层效果

2015-03-08  本文已影响3215人  BIDIU猿

jquery不能驾驭就用bootstrap干活吧哈哈

html
<!DOCTYPE html>  
<html>  
    <head>  
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">  
        <link rel="stylesheet" href="http://files.cnblogs.com/rubylouvre/bootstrap.css"/>   
        <script src="http://files.cnblogs.com/rubylouvre/jquery1.83.js" > </script>  
        <script src="http://files.cnblogs.com/rubylouvre/bootstrap-transition.js"></script>  
        <script src="http://files.cnblogs.com/rubylouvre/bootstrap-modal.js"></script>  
   
         
    </head>  
    <body>  
        <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>  
        <!-- Modal -->  
        <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">  
            <div class="modal-header">  
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>  
                <h3 id="myModalLabel">Modal header</h3>  
            </div>  
            <div class="modal-body">  
                <p>弹出层…</p>  
            </div>  
            <div class="modal-footer">  
                <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>  
                <button class="btn btn-primary">Save changes</button>  
            </div>  
        </div>  
    </body>  
</html>  

调出弹出框框要有超链接。
超链接中要有data-toggle="modal"标签,链接href="#a"要和弹出框的id="a"相符。
弹出框标签class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"尚未搞懂吃个饭继续。

上一篇下一篇

猜你喜欢

热点阅读