채택완료
이 코드가 에러 나는데, 도대체 무슨 이유 일까요?
맨 끝줄에서 에러가 나네요.
Copy
<link type="text/css" rel="stylesheet" href="css/demo.css" /> <link type="text/css" rel="stylesheet" href="../dist/core/css/jquery.mmenu.css" /> <link type="text/css" rel="stylesheet" href="../dist/addons/css/jquery.mmenu.dragopen.css" /> <!-- for the one page layout --> <style type="text/css"> #intro, #first, #second, #third { height: 400px; } #intro { padding-top: 0; } #first, #second, #third { border-top: 1px solid #ccc; padding-top: 150px; } </style> <!-- for the fixed header --> <style type="text/css"> .header, .footer { box-sizing: border-box; width: 100%; position: fixed; } .header { top: 0; } .footer { bottom: 0; } </style> <script type="text/javascript" src="http://hammerjs.github.io/dist/hammer.min.js"></script> <script type="text/javascript" src="../dist/core/js/jquery.mmenu.min.js"></script> <script type="text/javascript" src="../dist/addons/js/jquery.mmenu.dragopen.min.js"></script> <script type="text/javascript" src="../dist/addons/js/jquery.mmenu.fixedelements.min.js"></script> <script type="text/javascript"> $(function() { var $menu = $('nav#menu'), $html = $('html, body'); $menu.mmenu({ dragOpen: true }); var $anchor = false; $menu.find( 'li > a' ).on( 'click', function( e ) { $anchor = $(this); } ); var api = $menu.data( 'mmenu' ); api.bind( 'closed', function() { if ( $anchor ) { var href = $anchor.attr( 'href' ); $anchor = false; // if the clicked link is linked to an anchor, scroll the page to that anchor if ( href.slice( 0, 1 ) == '#' ) { $html.animate({ scrollTop: $( href ).offset().top }); } } } ); }); </script>
답변 1개
답변을 작성하려면 로그인이 필요합니다.