Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Test Modal</title>
- <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
- <script type="text/javascript" src="jquery-1.7.1.min.js"></script>
- <script src="js/bootstrap.min.js"></script>
- <script type="text/javascript">
- (function( $ ) {
- $.sbModal = function(title) {
- var html = '<div id="myModal" class="modal hide fade">'
- + '<div class="modal-header">'
- + '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>'
- + '<h3>'+title+'</h3>'
- + '</div>'
- + '<div class="modal-body">'
- + '<p>One fine body…</p>'
- + '</div>'
- + '<div class="modal-footer">'
- + '<a href="#" class="btn">Close</a>'
- + '<a href="#" class="btn btn-primary">Save changes</a>'
- + '</div>'
- + '</div>';
- $o = $(html);
- $find = $('#myModal');
- if ($find.length>0) {
- $find.remove();
- }
- $o.appendTo('body').modal();
- }
- $(document).ready(function(){
- $('#show_login').click(function(){
- $.sbModal('hello title');
- return false;
- });
- });
- })( jQuery );
- </script>
- </head>
- <body>
- <a href="#123123" id="show_login">Login</a>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement