Created
November 4, 2013 13:17
-
-
Save seyhunak/7302272 to your computer and use it in GitHub Desktop.
Rails - Twitter Bootstrap - Modal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a class="btn btn-huge btn-primary" href="/path" data-toggle="modal" data-target="#modal">New</a> | |
<div class="modal fade" id="modal" style="padding: 20px"> | |
<div class="modal-footer"> | |
<a href="#" class="btn btn-inverse">Close</a> | |
</div> | |
</div> | |
<script type="text/javascript"> | |
($("a[data-toggle=modal]")).click(function() { | |
var target, url; | |
target = ($(this)).attr('data-target'); | |
url = ($(this)).attr('href'); | |
return ($(target)).load(url); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment