I've been trying to get bootstrap's alerts messages to stick to the top like the navbar component but no success.
First, the context:
I'm sending an ajax request through jQuery and then process the response. This part of the idea is complete. All I need to do now is to know how to make an alert message appear at the top of the page right under the navbar that is fixed to the top thanks to bootstrap's navbars. I've tried many things with the affix classes but still can't do it.
Here's where I try to create a div
element behaving like the alert message:
success:function(msg) {
if (msg == "fail") {
$('body').append('<div class="alert alert-error affix-top"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error !</strong> You can\'t specify a closed status if status is not set as "closed"</div>');
}
}
So I know for sure this works since the alert message is added but... at the bottom of the page. I want it to be like 5 pixels under the navbar component but can't make this work.
Any idea what I need to set to make this work?