weixin_33724059 2009-10-27 15:46 采纳率: 0%
浏览 38

如何用 Ajax 弹出警报?

我希望做一些类似Stackoverlow的功能,向用户展示重要的信息:比如2个新答案和1个新注释,这些都将显示在屏幕顶部的一个橙色div中,作为一种警告,并在其上有一个X来关闭窗口。我想使用jQuery来做这件事,因为这是我选择的库。有什么教程或代码样本可以寄给我吗?谢谢!
  • 写回答

1条回答 默认 最新

  • larry*wei 2010-05-28 17:11
    关注

    For this, you'll want to combine two concepts:

    The first is having a div that shows at the top of the page. Take a look at this tutorial, which shows you how to place <div>s over top of each other. Essentially, you'll want your info bar placed at the top with a z-order of something larget than everything else in the same spot.

    Once you have it where you want it, you'll then need to fade it in or out. This article will show you what is required to fade in/out divs using javascript.

    Just set the area's opacity to 100% and fade it in when the page loads. Then have a link or button that calls the javascript to fade out if you want to close it (or do it after a certain time).

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!