Open menu , body transform scale
Sun Sep 24 2023 18:35:10 GMT+0000 (Coordinated Universal Time)
Saved by @sagarmaurya19
https://lpl-4294384.hs-sites.com/sample-blog-triboxprivatewealth_march2023 https://triboxprivatewealth.com/contact/ // ========= mobile menu $(".mobile-trigger").click(function(e) { e.stopPropagation(), e.preventDefault(), $(".site-wrapper .body-content-wrap").css({ position: "relative", top: "-" + $(document).scrollTop() + "px" }), $("body").toggleClass("mobile-open"), $("body").toggleClass("active"), $("body").removeClass("mobile-open3"); let bodyheight = $(window).innerHeight(); setTimeout((function() { $(".site-wrapper").css("height", bodyheight), $("body").toggleClass("mobile-open2") } ), 40) }); $(".mobile-trigger").click(function(e) { e.stopPropagation() }); $("body, .slide_out_area_close").click(function() { if ($(window).width() < 991 & $("body").hasClass("mobile-open")) { $("body").removeClass("active"); var elmPos = Math.abs($(".site-wrapper .body-content-wrap").css("top").replace("px", "")); $("body").addClass("mobile-open3"), window.scrollY = elmPos, document.documentElement.scrollTop = elmPos; var intVar = setInterval(function() { window.scrollY = elmPos, document.documentElement.scrollTop = elmPos }, 10); setTimeout(function() { window.scrollY = elmPos, document.documentElement.scrollTop = elmPos, $(".site-wrapper").css("height", "auto") }, 40), setTimeout(function() { $("body").removeClass("mobile-open2"), setTimeout(function() { $(".site-wrapper .body-content-wrap").css({ position: "relative", top: "auto" }), $("body").removeClass("mobile-open3"), $('body').addClass('scroll-header animate'), setTimeout(function() { $('body').addClass('scroll-header animate'); }, 10), clearInterval(intVar), window.scrollY = elmPos, document.documentElement.scrollTop = elmPos }, 805) }, 40) } }) $(".slide_out_area_close").click(function(e) { e.preventDefault() }); $("body, .slide_out_area_close").click(function() { $("body").removeClass("mobile-open") }); $(".mobile-trigger").click(function(e) { e.stopPropagation() }); $('.slide-out-from-right .off-canvas-menu-container.mobile-only>ul li.hs-item-has-children>a').click(function(e) { e.preventDefault(); $(this).parent().siblings('.hs-item-has-children').removeClass('child-open'); $(this).parent().siblings('.hs-item-has-children').find('.hs-menu-children-wrapper').slideUp(300); $(this).next('.hs-menu-children-wrapper').slideToggle(300); $(this).next('.hs-menu-children-wrapper').children('.hs-item-has-children').find('.hs-menu-children-wrapper').slideUp(300); $(this).next('.hs-menu-children-wrapper').children('.hs-item-has-children').removeClass('child-open'); $(this).parent().toggleClass('child-open'); return false; }); $(window).scroll(function(){ if($(window).scrollTop() + $(window).height() > ($(document).height() - 100) ) { $('body').addClass('on-footer'); } else{ $('body').removeClass('on-footer'); } }); /* base html */ <div class="site-wrapper"> <div class="site-wrapper-inner"> <div class="body-wrapper {{ builtin_body_classes }}"> <div class="body-wrapper-inner"> {% block header %} {% global_partial path='../partials/header.html' %} {% endblock header %} <div class="body-content-wrap"> {% block body %} {% endblock body %} {% block footer %} {% global_partial path='../partials/footer.html' %} {% endblock footer %} </div> </div> </div> </div> </div> /*//============= css*/ .site-wrapper { transition: transform .8s cubic-bezier(.15,.2,.1,1); transform-origin: center; position: relative; z-index: 10; } .mobile-open .site-wrapper { height: 100vh; } .mobile-open2 .site-wrapper { -webkit-transition: transform .8s cubic-bezier(.15,.2,.1,1); transition: transform .8s cubic-bezier(.15,.2,.1,1); -webkit-transform: scale(.835) translateX(-466px) translateZ(0)!important; transform: scale(.835) translateX(-466px) translateZ(0)!important; } .mobile-open .site-wrapper, .mobile-open3 .site-wrapper { height: 100vh!important; overflow: hidden } .mobile-open2 .site-wrapper { overflow: hidden } .site-wrapper-inner { height: auto!important; } .mobile-open2 .site-wrapper-inner { -webkit-transform: scale(1.007)!important; transform: scale(1.007)!important; -webkit-transform-origin: top; transform-origin: top; } body.mobile-open { overflow: hidden } .mobile-open .site-wrapper-inner { pointer-events: none; } .mobile-open .site-wrapper { cursor: pointer; }
Comments