简体   繁体   中英

using the jNotify plugin for jquery

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM