Answers

Question and Answer:

  Home  JQuery Programmer

⟩ Why is the block display style used for animations?

In html only the block level elements can have custom heights and widths. So when a user defines an animation method for usage such as show, hide, slide up etc the display css property of the block being animated is set to display block style. On completion of the animation the display style of the block would be changed to its original value. This procedure does not work properly for inline elements and the following workarounds can be applied to it:

- If the user wants the element to remain inline and only want to animate it in and out he can use the fadein and fadeout animation instead of using the show method.

- The user can also use a block level element with float to make the element appear inline with the rest of the content around it.

 159 views

More Questions for you: