Mike's Modal Library
Mike's Modal Library is a Facebook-like photo library written to support photos and comments on an individual photo.
A special thanks to fgnass for the spin.js library
Example Sites
Usage
- Download the JavaScript file and stylesheet, and include them.
<link type="text/css" rel="stylesheet" media="all" href="https://raw.github.com/MikeSilvis/mikes-modal-library/master/lib/mikes-modal.css"> <script src="http://raw.github.com/MikeSilvis/mikes-modal-library/master/lib/mikes-modal.min.js" type="text/javascript"></script>
- Create a div on your page with the class .mikes-modal
<div class="mikes-modal" id="myModal"> <img src='http://s3.amazonaws.com/ultimate_whip/garage_photos/photos/000/000/079/large/38779594009_original.jpeg?1349826286'> <div class="description"> <h1>Title of Modal</h1> <p>Put whatever content you need here. I personally used it for comments and tags :)</p> </div> </div>
- Add a button, link, image or whatever you need to open the modal.
<a id="open-mikes-modal" class="btn btn-primary btn-large">Try it now!</a>
- Add a jQuery callback when you click the button
jQuery(function() { $("#open-mikes-modal").click(function(e) { $("#myModal").mikesModal(); }); });
Helpers
For custom functions you can bind / trigger the following manually:
$("#myModal").trigger("open"); $("#myModal").trigger("close"); $("#myModal").bind("open", function() { myCustomFunction(); });
Contributing
- Fork it.
- Create a branch (
git checkout -b my_awesome_branch
) - Edit the files in the src folder ONLY
- run cake build note you may need to run
npm install snockets
- Commit your changes (
git commit -am "Added some magic"
) - Push to the branch (
git push origin my_awesome_branch
) - Send a pull request
License
(The MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the βSoftwareβ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED βAS ISβ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.