Highlighting & Colouring elements.
Ext has some great effects (FX) which can be found in the Ext.FX class in the API, this page demonstrates how you can highlight or colour various elements.
This might be useful to illuminate a part of your page after an error - or to highlight something like a div to draw your users eye to it..
Worth a mention...
One thing to note on the fadeOut method is that as the FX functions have their own queue of events, the assumption is that you would colour the element when hidden - unfortunately the queue is only good for the FX and not normal element work, so we have used a config option to set an afterStyle option which applies a css style to the element after the FX, this of course cures the queue issue!
We used...
- Ext.FX : Provides useful effects to build upon.
- highlight -> Highlights an element with a given colour
- fadeOut -> Fades an element out (optionally can remove too)
- fadeIn -> Fades an element in (makes it visible)
- frame -> Projects a neat frame effect over an element when activated
- Ext.Element : Provides methods/functions to retrive DOM/Page elements.
- get -> Pull an element from the DOM/page and work with it
Try it out!
I am a div with an ID of 1, the paragraph under me will highlight yellow...
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ornare fringilla ante. Sed auctor. Donec gravida interdum tellus. Aliquam vehicula mauris dapibus arcu. Phasellus nibh velit, hendrerit a, adipiscing vitae, eleifend quis, libero. Fusce eleifend iaculis erat. Suspendisse rhoncus nisi in arcu. Ut non augue. Ut consequat vehicula elit. Mauris quam. Vivamus iaculis, magna varius ornare porta, nulla diam venenatis libero, vel mattis dui pede vel dui. Praesent dapibus mauris non neque. Suspendisse eget orci. Suspendisse at nisl. Nam mauris dolor, mollis ut, mollis at, semper quis, augue. Morbi ornare. In eu mi non libero porttitor pharetra. Nullam sagittis vulputate orci. In eget sem quis nibh dignissim dignissim. Mauris in pede
I am a Div 2 and I will change colour before your eyes!
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ornare fringilla ante. Sed auctor. Donec gravida interdum tellus. Aliquam vehicula mauris dapibus arcu. Phasellus nibh velit, hendrerit a, adipiscing vitae, eleifend quis, libero. Fusce eleifend iaculis erat. Suspendisse rhoncus nisi in arcu. Ut non augue. Ut consequat vehicula elit. Mauris quam. Vivamus iaculis, magna varius ornare porta, nulla diam venenatis libero, vel mattis dui pede vel dui. Praesent dapibus mauris non neque. Suspendisse eget orci. Suspendisse at nisl. Nam mauris dolor, mollis ut, mollis at, semper quis, augue. Morbi ornare. In eu mi non libero porttitor pharetra. Nullam sagittis vulputate orci. In eget sem quis nibh dignissim dignissim. Mauris in pede
