Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addAccountLeftAreaResizeHandler() {
- let leftAreaTab = $('#account-form #left-area .left-area-tab:visible');
- const initialDivHeight = window.innerHeight - window.innerHeight / 3.8;
- if ($(document).scrollTop() === 0) {
- leftAreaTab.height(window.innerHeight - window.innerHeight / 3.8);
- } else {
- leftAreaTab.height(window.innerHeight - window.innerHeight / 13 - 40);
- }
- window.addEventListener('scroll', function () {
- let leftAreaOffsetTop = $('#account-form #left-area').offset().top;
- let scrollTop = $(document).scrollTop(),
- div = $('#account-form #left-area .left-area-tab:visible'),
- divHeight = div.height();
- // divInnerHeight = div.children().first()[0].clientHeight;
- if (scrollTop < leftAreaOffsetTop) {
- div.animate({
- height: `${initialDivHeight + scrollTop + window.innerHeight / 110}px`
- }, 1);
- }
- else if (divHeight >= window.innerHeight || (divHeight + scrollTop) >= window.innerHeight) {
- div.animate({
- height: `${window.innerHeight - window.innerHeight / 13 - 40 }px`
- }, 1);
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement