init
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* SewJoy Theme - Main JavaScript
|
||||
*/
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
// Log on load
|
||||
console.log('SEWJOY THEME 已加载');
|
||||
|
||||
// Document-ready functionality
|
||||
$(function () {
|
||||
// Smooth scroll for in-page anchors
|
||||
$('a[href*="#"]:not([href="#"])').on('click', function (event) {
|
||||
var target = $(this.getAttribute('href'));
|
||||
if (target.length) {
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top - 60
|
||||
}, 600);
|
||||
}
|
||||
});
|
||||
|
||||
// Highlight current menu item visually
|
||||
$('.main-navigation li.current-menu-item, .main-navigation li.current_page_item')
|
||||
.addClass('active');
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user