JavaScript make div bigger and animate bigger section upwards on hover make eraser bigger in animate

You can do this using transform:scaleY() and set the transform-origin to bottom. I also put a margin-top:100px to see the effect better. Also you can use transition to make the scale smoother

You also need to scale back the text.

See here: jsfiddle

You need to scale the text back to it's original state in the same time that you scale the div. so if you scale the div 2 times. You need to scale back the text with 1/2 , same if you scale 3 times...scale back with 1/3

In this case you enlarge .content by 1.5 so you need to scale down the text inside by 1/1.5 = 0.66

Code:

.box {
  height: 170px;
  padding-bottom: 15px;
  width: 50%;
}

.content {
  background-color: #e3e4e6;
  height: 100%;
  text-align: center;
  margin-top: 300px;
  transition:0.3s;
}

.content:hover p {
  transform: scaleY(0.66)
}

.content:hover {
  transform: scaleY(1.5);
  transform-origin: bottom;
}
<div class="box">
  <div class="content">
    <p>
      TEST
    </p>
  </div>
</div>
Answer:1

Try it like this (I have no other idea...): You can give to the class "box" a bigger height (I put a red border around, so you can see it) than the class "content". After that, you can use flexbox, to put the class "content" on the bottom. After that, you can do it with hover to change your heigth upwards and fill it. With transition you can make a nice animation. I hope this is good enough. Perhaps there is also a way with jQUery at the moment I havn't got an idea. Let me know, if this helps you (I'm not sure if I understanded the question well) - Cheers. (Important: This heights and so on are just random values for testing)

.box {
  display: flex;
  justify-content: flex-end;
  flex-direction: column;
  height: 100px;
  border: 1px solid red;
}
.content {
  background-color: #e3e4e6;
  height: 50px;
  width: 100%;
  text-align: center;
  -webkit-transition: height 1s;
  /* Safari */
  transition: height 1s;
}
.content:hover {
  height: 100%;
}
<div class="box">
  <div class="content">TEST</div>
</div>
Answer:2

If you just want to use css, just use:

.content:hover {
  margin-top: -50px;
  height: 110%;
}

See jsFiddle

Answer:3

since there isn't any space at top to expand, you may give an extra margin initially and remove it on hover like this JsFiddle -

.box {
  height: 170px;
  padding-bottom: 15px;
  width: 50%;

}

.content {
    background-color: #e3e4e6;
    height: 100%;
    text-align: center;
    margin-top:25px;
}

.content:hover {
  height: 110%;
  margin-top:0;
}
Answer:4

Set top property with the value of height - 100 * -1

https://jsfiddle.net/x3cL1cpt/7/

.content:hover {
  height: 110%;
  top: -10%;
  position: relative;
}

Why position relative? It's because I move the box, but without modifying the space that the box occuped. If you need to modify that space, change top with margin-top.

Answer:5

The question is simple, but can't really find an answer. How to simulate the drag & drop events using chrome developer tools ? sure i can manually drag & drop the file, but then i can't ...

The question is simple, but can't really find an answer. How to simulate the drag & drop events using chrome developer tools ? sure i can manually drag & drop the file, but then i can't ...

  1. google chrome developer tools
  2. google chrome developer dashboard
  3. google chrome developer console
  4. google chrome developer edition
  5. google chrome developer tools shortcut
  6. google chrome developer settings
  7. google chrome developer tools mobile
  8. google chrome developer tools disabled
  9. google chrome developer channel
  10. google chrome developer tools view cookies
  11. google chrome developer tools color picker
  12. google chrome developer tools mobile view
  13. google chrome developer extensions
  14. google chrome developer tools dark theme
  15. google chrome developer support
  16. google chrome developer tools network tab
  17. google chrome developer tools not working
  18. google chrome developer tools disable cache
  19. google chrome developer tools iphone
  20. google chrome developer tools crash course

Given an <input id="foo"> element, I want to call an existing function on blur and pass an anonymous callback to it. Case 1, simple function call: function bar(){ alert("I am"); } $("#...

Given an <input id="foo"> element, I want to call an existing function on blur and pass an anonymous callback to it. Case 1, simple function call: function bar(){ alert("I am"); } $("#...

  1. passing anonymous functions in matlab
  2. passing anonymous functions javascript
  3. passing parameters to anonymous functions javascript
  4. passing arguments to anonymous functions javascript

It is one of the challenge in the book I fail to understand, or my brain is unable to break it down. Here is the solution function: function arrayToList(array) { var list = null; for (var i = ...

It is one of the challenge in the book I fail to understand, or my brain is unable to break it down. Here is the solution function: function arrayToList(array) { var list = null; for (var i = ...

  1. converting array to linked list java
  2. convert array to linked list c++
  3. convert array to linked list
  4. convert array to linked list python
  5. convert array to linked list javascript
  6. convert array into linked list
  7. convert array into linked list java
  8. convert array into linked list c++

I've got myself a bit confused here, so I'm looking for a bit of guidance. Basically, I have an app which talks to an API and gather information on 'Tours'. The first request retrieves the 3 tours (...

I've got myself a bit confused here, so I'm looking for a bit of guidance. Basically, I have an app which talks to an API and gather information on 'Tours'. The first request retrieves the 3 tours (...

  1. passing array to function using pointer
  2. passing structure to function using pointer
  3. passing array using function in c
  4. passing arguments to function using pointers
  5. passing array using function
  6. parameter passing using function
  7. passing 2d array to function using pointer
  8. passing arguments to php function using jquery