tags:

views:

45

answers:

4

How can show closeable in the top of the page like stackoverflow new answers. im using asp.net

+1  A: 

Stackoverflow uses Javascript with the JQuery library to create this.

Oded
+2  A: 

Do you mean the notification bar? If so, there is a nice demo and code snippet here.

http://tympanus.net/codrops/2009/10/29/jbar-a-jquery-notification-plugin/

Barry
@Barry Thanks for this one! This would help.
dkris
It makes me sad that there's a plug-in for something that's LITERALLY 2 lines of code. 3 if you want it to remove itself after X time.
Erik
+1  A: 

Here are a few jQuery imlpementations of the effect you looking for:

You will have to build on these.

dkris
+2  A: 

It's really pretty simple - there's a div, with a control in it (an anchor I imagine) with a click event bound to it which removes the parent item from the DOM. Something like this

 <!-- html -->
 <div id="warning"><a href="#" class='close'>[X]</a></div>

And then some event goodness:

$(document).ready(function() {
    $('.close').bind('click', function(e) {
         $(this).parent.remove();
    });
});

and you're pretty much done. Add salt and CSS to taste.

Erik