Hi there,

I just committed a simple support to fade out notices. For instance
sometimes we just want to render a notice somewhere in the page but we
want it to disappear after a few seconds. Say we have a form that
saves a record and then was want to say to the user that the item was
saved and we want this message to vanish after a little while.

This code is dependent on JQuery hence we have 3 functions in
net.liftweb.http.jquery.JqSHtml

A few examples:

fadeOutErrors(5 seconds, 1 second)
fadeOutWarnings(5 seconds, 1 second)
fadeOutNotices(5 seconds, 1 second)

All these functions return a JsCmd. This means that you can use this
as well for Ajax & Comet. But for Non Ajax here is a dummy example:

Assume a simple snippet:

  def howdy = {
    S.error("howdy error")
    <span>Hello there</span> ++
    <head>{Script(OnLoad(fadeOutErrors(5 seconds, 1 second)))}
    </head>
  }

So we set an error, return whatever the snippet returns (in this case
a simple span) and then concatenate the head tag where on load tell
lift to hide all errors after 5 seconds and the fade out time to be 1
second.

Br's,
Marius
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to