开发者

using the jNotify plugin for jquery

开发者 https://www.devze.com 2023-01-19 07:22 出处:网络
I am currently using jNotify to display my notifications.The problem is that all notifications seem to float over the website, instead of pushing the website down.I have looked at the above link and I

I am currently using jNotify to display my notifications. The problem is that all notifications seem to float over the website, instead of pushing the website down. I have looked at the above link and I can seen an option:

classContainer: "jnotify-container"       // className to use for the outer most container--this is where all the 

How 开发者_高级运维do I make use of this and will it push the website content down while the notification is being displayed?


That's simply the class name that gets applied to the container element. How that element looks is determined entirely by CSS.

Knowing the class name, you can write any CSS rules you like. The rule that makes the notification float on top of the site is position: fixed; and changing that to position: static; (the default value for position) will solve the "floating on top of the site" problem.

However, you'll then have a bigger problem. The reason jNotify's style is to float on top of the site is that it guarantees the notification will always be visible. If I have scrolled partway down the page and your notification is statically positioned at the top, I won't see it!


The classContainer part of jNotify seems to be broken, as they're not actually using that property.

The quickest work around I can see is to do the following:

  1. Open jquery.jnotify.js
  2. Find line 130 and change "appendTo" to "prependTo"
  3. In jquery.jnotify.css remove the following on lines 2, 3 and 4:

    position: fixed;

    top: 0;

    left: 0;

0

精彩评论

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