Cool Collapse/Expand Animation Effect

/, System UI/Cool Collapse/Expand Animation Effect

Cool Collapse/Expand Animation Effect

H

ave you ever wondered how Service-now does the collapse and expand animations in the application sidebar? This same animation effect is also used when collapsing form sections or displaying service catalog variable hints. I discovered last night how this is done and you can do it to with a simple script!

ServiceNow Collapse-Expand Effect

Update: ServiceNow now includes a full prototype effects library that you can use to collapse and expand, and more! Check out this post for details.

All you have to do to show and hide form elements with a cool expand/collapse animation is pass the correct DOM element into the functions using a client script as shown below…

//Collapse a given form element...
collapseEffect(ELEMENT);

//Expand a given form element...
expandEffect(ELEMENT);

So, if I wanted to collapse the ‘Comments’ field on the incident form…

collapseEffect(gel('incident.comments'));

Or if I wanted to expand that same ‘Comments’ field…

expandEffect(gel('incident.comments'));
By | 2018-07-09T15:00:00-06:00 April 19th, 2011|Categories: Client scripts, System UI|Tags: |1 Comment

About the Author:

One Comment

  1. Sean Grison April 20, 2011 at 1:43 am - Reply

    Cool!

Leave A Comment