Coder Social home page Coder Social logo

2braincells2go / jalert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from htmlguyllc/jalert

0.0 2.0 0.0 119 KB

jQuery alert/modal/lightbox plugin

Home Page: http://www.jqueryscript.net/lightbox/Customizable-jQuery-Modal-Dialog-Plugin-with-CSS3-Animations-jAlert.html

CSS 4.11% JavaScript 95.89%

jalert's Introduction

jAlert v3

by Versatility Werks http://flwebsites.biz

logo

Demo & Detailed Docs

http://flwebsites.biz/jAlert/

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/src/jAlert-v3.css">

Include the JS file from the src folder before the </body>:

<script src="jAlert-master/src/jAlert-v3.min.js"></script>
<script src="jAlert-master/src/jAlert-functions.min.js"></script> <!-- COMPLETELY OPTIONAL -->

Quick Use (requires jAlert-functions.js!!!)

  alert('hi'); //override is enabled by default works in code in console you get the default behavior and undefined
  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');
  });

This is the default usage. Doesn't require jAlert-functions.js

  $.jAlert({ //this is the normal usage
    'title': 'Test',
    'content': 'Howdy',
    'theme': 'green',
    'size': 'xsm'
  });
  $.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'
  });

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.

jalert's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.