djc_alert()

Created: 12/23/2014

Last update: 02/15/2015 - v2

By: Jaehwan Daniel Cho

Email: danielcho80@gmail.com

Description: Show various contents(html strings) in the overlay popup.

djc_alert( contents, options )

  • contents

    Type: String(HTML String)

    Text/HTML strings to insert to the overlay popup.

  • options

    • width

      Type: String

      A string width in pixels.
      The width of the overlay popup.

    • height

      Type: String

      A string height in pixels.
      The height of the overlay popup.

    • color (default: the colors in CSS - djc_popup_style.css)

      • overlay_div

        Type: String(hexadecimal color codes or HTML color names)

        A color of the Div overlay.

      • overlay_opacity

        Type: Number

        An opacity fo the Div overlay.

      • background

        Type: String(hexadecimal color codes or HTML color names)

        A color of the overlay popup background.

      • font

        Type: String(hexadecimal color codes or HTML color names)

        A color of the overlay popup font.

      • border

        Type: String(hexadecimal color codes or HTML color names)

        A color of the overlay popup border.

    • btn_status

      • status (default: 0)

        Type: Integer

        0: no button, 1: OK button, 2: Confirm & Decline buttons

      • btn_label (default: "OK")

        Type: String

        A label for the "OK" button.

      • btn_confirm_label (default: "Confirm")

        Type: String

        A label for the "Confirm" button.

      • btn_decline_label (default: "No")

        Type: String

        A label for the "Decline" button.

      • callback

        Type: Function

        A function to call once the "OK" button is triggered.

      • confirm_callback

        Type: Function

        A function to call once the "Confirm" button is triggered.

      • decline_callback

        Type: Function

        A function to call once the "Decline" button is triggered.

    • btn_close_status

      • status (default: 1)

        Type: Integer

        1: image button, 2: text link

      • hide (default: 1)

        Type: Integer

        1: show close button, -1: remove close button.

      • label (default: "close")

        Type: String

        A label for the "close" button.

      • color (default: the color in CSS - djc_popup_style.css)

        Type: String(hexadecimal color codes or HTML color names)

        A color for the "close" button font.

      • img (default: the background image of #djc_close in CSS)

        Type: String

        A path of the "close" button image.

    • bg_close_event (default: 0)

      Type: Integer

      0: disabling close event for the overlay div, 1: enabling close event for the overlay div

    • beforeCallback

      Type: Function

      A function to call before the overlay popup shows up.

    • afterCallback

      Type: Function

      A function to call after the overlay popup shows up.

Installation: Add following JS & CSS files.

Installation - set up three main files

How to use: Simply add any text/html contents to the djc_alert( contents );. Also there are some options can be added to it like djc_alert( contents, options );.

Examples:

Colors: