File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,16 @@ document.addEventListener('DOMContentLoaded', function () {
55 const burgerBtn = document . querySelector ( '.open-modal' ) ;
66 const closeBtn = document . querySelector ( '.close-menu' ) ;
77 const mobileMenu = document . querySelector ( '.mobile-burger-menu' ) ;
8+ const orderBtnMob = document . querySelector ( '.order-btn-mob' ) ;
89
910 if (
1011 ! menuBtn ||
1112 ! navMenu ||
1213 navLinks . length === 0 ||
1314 ! burgerBtn ||
1415 ! closeBtn ||
15- ! mobileMenu
16+ ! mobileMenu ||
17+ ! orderBtnMob
1618 )
1719 return ;
1820
@@ -65,4 +67,19 @@ document.addEventListener('DOMContentLoaded', function () {
6567 closeMobileMenu ( ) ;
6668 } ) ;
6769 } ) ;
70+
71+ orderBtnMob . addEventListener ( 'click' , function ( e ) {
72+ e . preventDefault ( ) ;
73+ const targetId = this . getAttribute ( 'href' ) . substring ( 1 ) ;
74+ const targetSection = document . getElementById ( targetId ) ;
75+
76+ if ( targetSection ) {
77+ window . scrollTo ( {
78+ top : targetSection . offsetTop - 50 ,
79+ behavior : 'smooth' ,
80+ } ) ;
81+ }
82+
83+ closeMobileMenu ( ) ;
84+ } ) ;
6885} ) ;
You can’t perform that action at this time.
0 commit comments