
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
by HTMLGuy, LLC (https://htmlguy.com)
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.
Available on NPM (https://www.npmjs.com/package/jAlert):
npm install jAlert
jQuery 1.7+
Include the CSS files from the folder in the head section:
<link rel="stylesheet" href="jAlert-master/dist/jAlert.css">
Include the JS file from the folder before the </body>
:
<script src="jAlert-master/dist/jAlert.min.js"></script>
<script src="jAlert-master/dist/jAlert-functions.min.js"></script> <!-- COMPLETELY OPTIONAL -->
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');
});
$.jAlert({ //this is the normal usage
'title': 'Test',
'content': 'Howdy',
'theme': 'green',
'size': 'xsm'
});
alert('hi'); //override is enabled by default
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!'); //green alert
errorAlert('Error', 'It didn\'t work!'); //red alert
infoAlert('Info', 'Information!'); //blue alert
warningAlert('Warning', 'Warning!'); //yellow alert
blackAlert('Warning', 'Warning!'); //black alert (obviously)
imageAlert('http://mydomain.com/myimg.jpg'); //optional second param is the image width (defaults to auto)
videoAlert('http://youtube.com/viddk35k');
ajaxAlert('http://mydomain.com/myfile.php'); //optional second param is onOpen callback which gets passed the instance of jAlert
iframeAlert('http://mydomain.com'); //optional second param is height (defaults to fill the viewport height)
confirm(function(){
console.log('confirmed!');
}, function(){
console.log('denied');
});
$.fn.jAlert.defaults.backgroundColor = 'white'; //override a default setting
$.fn.jAlert({ //same as $.jAlert when you're not passing an element - this alert will now have the white background color
'title': 'Test',
'content': 'Howdy',
'theme': 'green',
'size': 'xsm'
//'backgroundColor': 'white' //you could also pass it here
});
$.fn.jAlert.defaults.backgroundColor = 'black'; //set it back to black
$('.btn').alertOnClick({ //this function attaches an onclick handler to .btn and passes the options to jAlert
'title': 'It worked!',
'content': 'You clicked the button'
});
$.alertOnClick('.btn', { //this function attaches an onclick handler to the body for .btn and kicks off jAlert
'title': 'Like magic',
'content': 'You clicked the button that was dynamically added'
});
$.jAlert({ //creates a lightbox for the image - responsive and all
'image': 'http://mysite.com/my-image.jpg'
});
$.jAlert({ //creates a lightbox for the video - responsive and all
'video': 'http://youtube.com/dflskd'
});
$.jAlert({ //creates an alert that fills most of the height with a scrollable iframe
'iframe': 'http://mysite.com'
});
$.jAlert({ //gets content from another file with $.get()
'ajax': 'my-ajax-content.php'
});
FAQs
Simple jQuery (Modal | Popup | Lightbox | Alert) Plugin
The npm package jAlert receives a total of 152 weekly downloads. As such, jAlert popularity was classified as not popular.
We found that jAlert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.