Jump to content
  • 0

Динамическое выпадение блока


Entense
 Share

Question

3 answers to this question

Recommended Posts

  • 0

Вот так можно. Если нужно чтоб b был дочерним элементу a, то логика, вероятно будет такой:

в первый момент анимации top: 100% (относительно родительского), при этом box-sizing можно присвоить border-box, дабы не думать о границах,

а height плавно увеличивать с 0 до нужного размера. В конце у блока b значение overflow с hidden можно поменять на auto, если предполагается что в блоке b много контента.

Также, по идее, всё это можно сделать через transition. Логика примерно таже, синтаксис немного отличается. Через транзишн плюс в том, что переход будет плавным и в обратную сторону, впрочем, возможно, так можно сделать и через анимацию, но что-то я, навскидку, не соображу как.

Edited by Launder
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy