简体   繁体   中英

jQuery Notification plugin on-demand function not working

Please view my Sample Fiddle ...

There's a notification bar that comes up. When I use this plugin where I got it ( here ), the plugin works great. There's really no documentation on this and I've gotten it installed and working - half way.

When the notification bar is closed, there's an arrow that's supposed to drop down to re-initiate it with a click. I can see the shadow from the arrow there, but it's not coming down.

Not sure how to make it pull down automatically as the author displays here

This is the script used to call the function...

       $(document).ready(function () {
            $('.notification.ondemand').notify();
            $('.button').click(function () {
                $('.notification').removeClass('hide').addClass('hide').removeClass('visible');
                $('.notification.' + $(this).attr('id') + '').notify({ type: $(this).attr('id') });

            });

        });

The drop-down arrow works on the demo, but not my site.

Can you please take a look?

Thanks,

The problem is the site demo where do you get the code; in the site example there is a buttonset with class .button that switch the notify behaviour by using the id of the cicked button:

$('.notification.' + $(this).attr('id') + '').notify({ type: $(this).attr('id') });

You don't have that button so you can use directly your needed notify type.

The possible values for type option are:

  • sticky
  • floated
  • fixed
  • ondemand

Code:

$(document).ready(function () {
    $('.notification.ondemand').notify({ type: 'ondemand' });    
});

Demo: http://jsfiddle.net/IrvinDominin/qYsfD/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM