I want to make “jQuery UI TAB” blink (like notification).
I have diffrent tabs (Inbox | Sent | Important). My timer function checks if there is a new message in inbox, if so, I want the Inbox tab to start blinking/ flashing unless its clicked open.
Have tried diffrent options like .effect(..), .tabs(fx: {..}) but nothing seems to work 🙁
Any idea if its possible or not?
Yes it’s definitely possible.
To give me some practice, I’ve written a jQuery
blinkerplugin for you:jQuery:
See it in action here
The plugin and the fiddle are pretty raw in that I haven’t tried to integrate with jQuery-ui-tabs. This may be easy or hard, I don’t know, but providing each tab is addressable by class or id then it shouldn’t be too difficult.
Something you may need to consider is stopping a blinking tab when it is clicked. For this you may wish to call the
.blinker('stop')method directly (with a.on('click')handler) or from an appropriate jQuery-ui-tabs callback.API
The plugin is properly written in jQuery’s preferred pattern. It puts just one member in the
jQuery.fnnamespace and.blinker(...)will chain like standard jQuery methods.Methods :
.blinker(options), or just.blinker()in its simplest form.Options : a map of properties, which determine blinker styles and timing:
By omitting
css_0from the options map, the OFF state is determined by the element(s)’ natural CSS styling defined elsewhere (typically in a stylesheet).Default values are hard-coded for
css_1.color,css_1.backgroundColor,cycletime andratio. Changing the default settings programmatically is not handled, so for different default styling the plugin will need to be edited.