jAlert v4
by Versatility Werks http://flwebsites.biz
Demo & Detailed Docs
What is it?
Simple jQuery (Modal | Popup | Lightbox | Alert) Plugin
Whether you call it a lightbox, modal, popup, or window, jAlert is an excellent replacement / alternative for Simple Modal, FancyBox, or Reveal.
Setup
Include the CSS files from the src folder in the head section:
<link rel="stylesheet" href="jAlert-master/dist/jAlert.css">
Include the JS file from the src folder before the </body>
:
<script src="jAlert-master/dist/jAlert.min.js"></script>
<script src="jAlert-master/dist/jAlert-functions.min.js"></script>
To use the 'data-jAlert' attributes, you must attach the handlers (must be re-attached for newly added dynamic content):
<a href='#' data-jAlert data-title='New jAlert!' data-content='Great job!'>Click Me</a>
$(function(){
$.jAlert('attach');
});
This is the default usage. Doesn't require jAlert-functions.js
$.jAlert({
'title': 'Test',
'content': 'Howdy',
'theme': 'green',
'size': 'xsm'
});
Quick Use (requires jAlert-functions.js!!!)
alert('hi');
Note: When you run alert() in your console, it works as expected but will return "undefined"...ignore that. It's just because the function doesn't return anything. Had to add this disclaimer because people got confused..lol..
successAlert('Success', 'You did it!');
errorAlert('Error', 'It didn\'t work!');
infoAlert('Info', 'Information!');
warningAlert('Warning', 'Warning!');
blackAlert('Warning', 'Warning!');
imageAlert('http://mydomain.com/myimg.jpg');
videoAlert('http://youtube.com/viddk35k');
ajaxAlert('http://mydomain.com/myfile.php');
iframeAlert('http://mydomain.com');
confirm(function(){
console.log('confirmed!');
}, function(){
console.log('denied');
});
$.fn.jAlert.defaults.backgroundColor = 'white';
$.fn.jAlert({
'title': 'Test',
'content': 'Howdy',
'theme': 'green',
'size': 'xsm'
});
$.fn.jAlert.defaults.backgroundColor = 'black';
$('.btn').alertOnClick({
'title': 'It worked!',
'content': 'You clicked the button'
});
$.alertOnClick('.btn', {
'title': 'Like magic',
'content': 'You clicked the button that was dynamically added'
});
$.jAlert({
'image': 'http://mysite.com/my-image.jpg'
});
$.jAlert({
'video': 'http://youtube.com/dflskd'
});
$.jAlert({
'iframe': 'http://mysite.com'
});
$.jAlert({
'ajax': 'my-ajax-content.php'
});
Dependencies
jQuery 1.7+
License
M.I.T.
Copyright (c) 2015 Versatility Werks
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.