There is a meteor app.
Here is the code :
html:
<header id="header"> <div id="div1"></div> </header> <div id="div2"></div> <button id="reset">reset</button>
css:
header { background: black; width: 100%; height: 60px; position: relative; } #div1 { background: yellow; width: 500px; height: 15px; position: absolute; right: 0; bottom: 0px; transition: all .5s; } #div2 { background: green; position: fixed; width: 500px; height: 0; right: .5%; transition: all .5s; }
js:
document.getElementById('header').onclick = function() { document.getElementById('div1').style.bottom = -110 + 'px'; document.getElementById('div2').style.height = 100 + 'px'; } document.getElementById('reset').onclick = function() { document.getElementById('div1').style.bottom = 0 + 'px'; document.getElementById('div2').style.height = 0; }
Idea:
when clicking on Heder, the coordinate of the first diva is lowered, and the height of the other diva appears. As a result, we have an analog of the sliding panel (everything is elementary). BUT: in Meteor, this code is not executed in parallel, but somehow awfully crooked: the first div falls faster than the height of the second increases. While the transition
the same duration. I tried through &.animate
- the same thing, everything is crooked, the blocks are animated independently of each other.
How to be? need a regular sliding panel, but does not work in any ...
Brothers! He spent the whole night on resolving this issue, but he still did not move a drop. Going to work not having slept. Find out the solution will be the best event for today!