开发者

How to add a bar like "Congrats ... – learn more" of this site? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I think the floating bar saying "Congrats, you've gained the privilege – talk in chat learn more" looks so cool, and so neat to for reporting status. How to add one to my own site please开发者_如何学JAVA?


Without looking at the StackOverflow source, the way I imagine it would be done is as follows:

Add a div called notify (or whatever else you want to call it) to the top of your page; something like this:

#notify{
width: 100%;
height: 30px;

position: absolute;

top: 0;

display: none;

z-index: 500;
}

Then use the jQuery slideUp and slideDown methods (or however else you want to) to animate it when a new notification is found via ajax. (you could use mootools or another JavaScript library if you wanted to)

( http://api.jquery.com/slideUp, http://api.jquery.com/slideDown, http://api.jquery.com/animate, and http://api.jquery.com/jQuery.ajax/ )


View > Page Source.

This is the div box that contains it (or at least appears to contain it). Seems that they are using jQuery with an accordion style action.

<div id="notify-container"></div>

http://jqueryui.com/demos/accordion/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜