Overview
Show a green highlight that fades away on a table row when a new record is added by a user. Add a pulsing yellow glow to a button you want the user to press next. With this open source YPulse library and YUI, both are easy to implement.
Example
View this example code here.
While both example above pulse the background color, YPulse can oscillate any attribute. So, you might use YPulse to oscilatte the opacity to make an object flash on and off the page.
Browser Support
The YPulse library should work with all the major browsers supported by YUI but has not been tested extensively.
Usage
You will need to upload ypulse.js to your webserver and you will need something like this on you page…
<div id=”my-div”>This is the element I want to pulse.</div>
<script type=”text/javascript” src=”http://yui.yahooapis.com/2.5.2/build/yahoo-dom-event/yahoo-dom-event.js”></script>
<script type=”text/javascript” src=”http://yui.yahooapis.com/2.5.2/build/animation/animation-min.js”></script>
<script type=”text/javascript” src=”ypulse.js”></script>
<script>var pulser = new YAHOO.squarebits.YPulse(
‘my-div’,
‘backgroundColor’,
‘#FFFFFF’,
‘#FFFF00′,
0.75,
0.10,
0.75,
0.75,
YAHOO.util.Easing.easeBoth,
YAHOO.util.Easing.easeBoth
);
Syntax
The YPulse constructor supports the following parameters…
- elem - The DOM element or element ID to pulse (like ‘my-div’)
- attributeName - The name of the attribute to change (like ‘backgroundColor’)
- startingValue - The starting value of the attribute (like ‘#FFFFFF’)
- endingValue - The name of the attribute to change (like ‘#FF0000′)
- s2eDuration - The number of seconds for the start-end transition
- s2eWait - The number of seconds to wait after completing the start-end transition
- e2sDuration - The number of seconds for the end-start transition
- e2sWait - The number of seconds to wait after completing the end-start transition
- s2eMthod - The YAHOO easing method to use for the start-end transition
- e2sMthod - The YAHOO easing method to use for the end-start transition
A YPulse instance object supports two methods…
- go(repeat) - Starts the pulse and executes the pulse for the specified repeat count. If repeat is omitted, the pulse never stops. If repeat is set to 1, only the start-end transition is done. If repeat is set to 2, the start-end transition and end-start transition are done
- stop() - Stops a running pulse
Download
You can download YPulse here: YPulse.
Bookmark at:StumbleUpon | Digg | Del.icio.us | Dzone | Newsvine | Spurl | Simpy | Furl | Reddit | Yahoo! MyWeb
Entries (RSS)
[...] Johnson has released YPulse a simple open source wrapper for the YUI Animation library that makes creating highlight fades and [...]
Wow. An upgrade to the famous blink tag? What’s next? YScroll for scrolling text? YRainbow to animate a rainbow pattern on the font color? If you’re action items blend in with the rest of the page, make the blink. wait. I mean pulsate.
[...] Johnson has released YPulse a simple open source wrapper for the YUI Animation library that makes creating highlight fades and [...]
[...] Johnson has released YPulse a simple open source wrapper for the YUI Animation library that makes creating highlight fades and [...]
[...] from Trendics: Kent Johnson from Trendics posted his YUI-based solution for colored pulse alerts, YPulse: “Show a green highlight that fades away on a table row when a new record is added by a user. [...]
Funny as josh m thinks he is, animation is a powerful tool for informing users of state changes.
See http://developer.yahoo.com/ypatterns/parent.php?pattern=transition for more information
revisited!
oops.. “«blinkg» revisited” it should have read.
the example on this page doesn’t work for me, neither on Safari 3.1.2. nor on Firefox 3, both on the Mac. “Bad server certificate” for ypulse, says safari.
[Blink](http://en.wikipedia.org/wiki/Blink_tag) 2.0