chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* @Author: YwxApp <ywx@ywxapp.cn>
|
||||
* @Date: 2026-08-09 16:41:46
|
||||
* @LastEditors: YwxApp <ywx@ywxapp.cn>
|
||||
* @LastEditTime: 2026-08-09 22:08:01
|
||||
* @Description:
|
||||
* @FilePath: \ywxapp_dev\public\static\frontend\js\firm.js
|
||||
* @CustomString: Copyright (c) 2026 YwxApp
|
||||
*/
|
||||
/**
|
||||
* YwxApp Frontend 交互脚本(基于 layuiNetCompany 模板适配重构)
|
||||
*/
|
||||
layui.define(['jquery', 'carousel'], function (exports) {
|
||||
var $ = layui.jquery;
|
||||
var carousel = layui.carousel;
|
||||
|
||||
// 顶部通知轮播
|
||||
if ($('#siteNoticeCarousel').length) {
|
||||
carousel.render({
|
||||
elem: '#siteNoticeCarousel',
|
||||
width: '100%',
|
||||
height: '40px',
|
||||
arrow: 'none',
|
||||
indicator: 'none',
|
||||
anim: 'updown',
|
||||
autoplay: true,
|
||||
interval: 3500
|
||||
});
|
||||
}
|
||||
|
||||
// 移动端导航切换
|
||||
var $trigger = $('#navTrigger');
|
||||
var $menu = $('#navMenu');
|
||||
if ($trigger.length && $menu.length) {
|
||||
$trigger.on('click', function () {
|
||||
$(this).toggleClass('open');
|
||||
$menu.toggleClass('open');
|
||||
});
|
||||
// 点击菜单项后收起(移动端)
|
||||
$menu.find('a').on('click', function () {
|
||||
if ($(window).width() <= 768) {
|
||||
$trigger.removeClass('open');
|
||||
$menu.removeClass('open');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 返回顶部
|
||||
var $goTop = $('#goTop');
|
||||
$(window).on('scroll', function () {
|
||||
if ($(this).scrollTop() > 300) {
|
||||
$goTop.fadeIn();
|
||||
} else {
|
||||
$goTop.fadeOut();
|
||||
}
|
||||
});
|
||||
$goTop.on('click', function () {
|
||||
$('html, body').animate({scrollTop: 0}, 300);
|
||||
});
|
||||
|
||||
exports('firm', {});
|
||||
});
|
||||
Reference in New Issue
Block a user