Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiding The Nofify programmably #129

Open
BuffaloBrennan opened this issue Nov 29, 2019 · 0 comments
Open

Hiding The Nofify programmably #129

BuffaloBrennan opened this issue Nov 29, 2019 · 0 comments

Comments

@BuffaloBrennan
Copy link

Hi, hopefully someone can help

I been looking for a Notify that can attached itself to an object and this works brilliantly

in my header.php file, used for all my screens, I have a small "Bull Horn" symbol that I use to display the number of messages waiting to be displayed, similar to Facebooks notifications. I use the following code:

  • I then set up the rest with:

    $.notify.defaults({autoHide: false, arrowSize: 10}) ;

    function checkForNotifications() {
    $.getJSON("/server_side/scripts/ajax_retrieveNumberOfNotificationsForStaffID.php?staffID=", function (data) {
    $.each(data.theData, function (i, data) {
    if (data.noOfMessages != 0 ) {
    $(".showNotifications").notify(data.noOfMessages, {position: "right", className: "info"});
    }
    });
    });
    }

    setInterval(checkForNotifications,2000);

    and it works great constantly checks great,works sweet as a nut..

    Click on the Bullhorn and I use Nofify again to display the individual messages waiting. However, the other screens still say there are messages, because the Notify is only displayed is there are any. What I want to use, is an else to make it disappear on the next interval. I've tried various methods, but it either stayes there or the messages I want to see are also deleted/removed from the screen.

    If anyone has any ideas that would be great.

    However, because this is used on all screens - the other screens show the

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant