How to use Pines Notify jquery plugin?

I want to show a notification on my website using the Pines Notify jQuery plugin but I don't know how to use it. Can someone provide an example code?

+3
source share
4 answers

This is the only link I found for documentation: http://sourceforge.net/apps/mediawiki/pines/index.php?title=Pines_Notify

+13
source

It is pretty easy to find out.

  • Go to the pines notifications website: http://pines.sourceforge.net/pnotify/

  • Press the buttons until you find the effect that you want to do yourself.

  • Chrome Firefox w/Firebug . , , onclick = "":


onclick="$.pnotify({
    pnotify_title: 'Regular Notice',
    pnotify_text: 'Check me out! I\'m a notice.'
});"

, html- jquery, - :


// call your jquery and pines notify plugin scripts first

$.pnotify({
   pnotify_title: 'Whatever the Title Is',
   pnotify_text: 'This is the text of the notice!'
});

, , , jines pines , .

+4

, Pines Notify . - HTML . JavaScript ( , yuck).

+2

HTML. , javascript-.

function gaserror(){
var distance = Number(document.cars.distance.value);
switch( $('#listofcars :selected').text())
{
    case 'Volvo':
        if (distance>500)
            {
            $.pnotify({
                title: 'Error',
                text: 'You have run out of gas!',
                addclass: 'custom',
                type: 'error',
                opacity: 0.8,
                nonblock: true,
                nonblock_opacity: 0.2,
                sticker: false,
                stack: false,
                mouse_reset: false,
                history:false, //prevents the yellow error history tab from appearing after error triggered
                before_open: function(pnotify) {
                        pnotify.css({
                            "top": ($(window).height() / 2) - (pnotify.height() / 2),
                            "left": ($(window).width() / 2) - (pnotify.width() / 2)
                        });
                    }
                });
            }
        break;}}
0

Source: https://habr.com/ru/post/1774536/


All Articles