0

When I click on a button it shows an amazing notification at the top of the screen. Now I want to show this notification to the user as soon as he loads the page, but how can i do this?

This is the code of the button:

<span class="btn btn-success" data-layout="top" data-type="success" data-toggle="notyfy">Success</span>

Thanks for your time.

2
  • Do you mean alert? getbootstrap.com/components/#alerts Commented Jul 4, 2016 at 20:54
  • Just add an id to your span like id="spanSuccess"...and then, this piece of code should do the trick: $(function(){ $('#spanSuccess').click(); }); Commented Jul 4, 2016 at 20:54

1 Answer 1

2

I think you are using notyfy jquery plugin. So you can do this:

$(document).ready(function() {
  notyfy({text: 'notyfy - Yet another jQuery notification plugin'});
});
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, this works how I wanted it to be. But how can I change the color of the notification to green? So it looks like a succes message. @adriancarriger
In the button you can find data-type="success", changing this also changes the layout of the notification, but the code from the fiddle always uses the white background.
Just add type: 'success' like this
Ahh you are amazing! @adriancarriger

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.