html - How can I make transition property work in IE by using calc properties? -
element1 { height: calc(100% - 50px); -webkit-transition: .5s; -moz-transition: .5s; -ms-transition: .5s; -o-transition: .5s; transition: .5s; } element1:hover { height: calc(100% - 200px); }
when replace calc in height property px
or %
, transition works fine, calc
, goes 1 height without transition.
in other browsers works fine, problem in ie
adding code , jsfiddle example similar real situation.
div{ position: fixed; right: 0; width: 250px; height: calc(100% - 200px); background: #1c8080; top: 158px; color: #fff; text-align: center; padding-top: 40px; font-size: 18px; border: 1px solid #000; -webkit-transition: .3s; -moz-transition: .3s; transition: .3s; } div:hover{ height: calc(100% - 100px); top: 58px; } .bottom{ position: absolute; bottom: 15px; width: 100%; font-size: 26px; }
<div> <p>height's tansition</p> <p>works fine in chrome, ff</p> <p class="bottom">but not in ie</p> </div>
yes, know in case setting bottom: 0
<div>
, changing height, works due bug in ie, changes 1 height one, why simulated effect, changing top position , height.
so, how can simulate kind of effect in ie?
note: can't use viewport units: vh
, vw
.
pd: rare behavior ie in case because transition top: value
top: othervalue
works transition height: calc(value)
height: calc(othervalue)
not, guide.
what this? works code snippet (in opinion), it's ok in ie10/ie11. or didn't understand real situation.
html, body { width: 100%; height: 100%; } div { position: fixed; right: 0; width: 250px; bottom: 0; background: #1c8080; top: 158px; color: #fff; text-align: center; padding-top: 40px; font-size: 18px; border: 1px solid #000; -webkit-transition: .3s; -moz-transition: .3s; transition: .3s; } div:hover { top: 58px; } .bottom { position: absolute; bottom: 15px; width: 100%; font-size: 26px; }
<div> <p>height's transition</p> <p>works fine in chrome, ff</p> <p class="bottom">but not in ie</p> </div>
Comments
Post a Comment