LIM123456-优源库博客
优源库官网-免费教程源码-插件模板-软件工具下载平台-互联网开发者资源库
LIM123456的头像-优源库博客
这家伙很懒,什么都没有写...
  • 12

    会员总数

  • 81

    文章总数

  • 10029

    浏览总数

  • 3

    今日发布

  • 68天

    稳定运行

  • 波浪
  • 波浪
  • 波浪
  • 波浪
雪花效果控制
jQuery(document).ready(function($) { // 收藏按钮点击事件 - 修复无反应问题 $('#shoucang').on('click', function(e) { e.preventDefault(); layer.msg('

在键盘上按Ctrl+D即可
喜欢本站的话记得常来哦!

', function(){}); }); // 赞赏按钮点击事件 - 修复无反应问题 $('#dorzs').on('click', function(e) { e.preventDefault(); // 如果存在赞赏弹窗函数则调用 if (typeof showRewardModal === 'function') { showRewardModal(); } else { // 默认显示赞赏提示 layer.msg('

感谢您的赞赏支持!

', function(){}); } }); // 返回顶部点击事件 $('#percentage').on('click', function(e) { e.preventDefault(); $('html, body').animate({scrollTop: 0}, 500); }); // 评论跳转 $('.pl a').on('click', function(e) { e.preventDefault(); if ($('#comments').length) { $('html, body').animate({ scrollTop: $('#comments').offset().top - 100 }, 500); } }); // 点赞功能 $('.like-btn').on('click', function(e) { e.preventDefault(); var $this = $(this); var post_id = $this.data('id'); $.ajax({ url: '', type: 'POST', data: { action: 'post_like', post_id: post_id }, success: function(response) { if (response.success) { layer.msg('点赞成功!', {icon: 1}); // 更新点赞数 $this.html('点赞(' + response.data.count + ')'); } else { layer.msg(response.data.message || '点赞失败', {icon: 2}); } } }); }); }); // 滚动进度条百分比 - 修复显示问题 window.onscroll = function() { let scrollNow = window.pageYOffset; let pageClientHeight = document.documentElement.clientHeight; let scrollHeight = Math.max( document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight ) - pageClientHeight; // 防止除零错误 if (scrollHeight <= 0) scrollHeight = 1; let fullWindowHeightInPercentage = Math.round((scrollNow / scrollHeight) * 100); let percentage = document.getElementById('percentage'); if (percentage) { if (fullWindowHeightInPercentage == 0) { percentage.innerHTML = ' 到顶啦'; } else if (fullWindowHeightInPercentage >= 100) { percentage.innerHTML = ' 到底啦'; } else { percentage.innerHTML = ' ' + fullWindowHeightInPercentage + '%'; } } }; // 底部滚动文字功能 (function() { var $this = document.getElementById("footgundong"); if (!$this) return; var scrollTimer; $this.addEventListener('mouseenter', function() { clearInterval(scrollTimer); }); $this.addEventListener('mouseleave', function() { scrollTimer = setInterval(function() { scrollNews($this); }, 2000); }); function scrollNews(obj) { var $self = obj.querySelector('ul'); if (!$self) return; var firstLi = $self.querySelector('li:first-child'); if (!firstLi) return; var lineHeight = firstLi.offsetHeight; $self.style.transition = 'margin-top 0.5s'; $self.style.marginTop = -lineHeight + 'px'; setTimeout(function() { $self.style.transition = 'none'; $self.style.marginTop = '0'; $self.appendChild(firstLi); }, 500); } })();

右侧导航设置

签到按钮

在线客服

打赏按钮

二维码

VIP按钮

夕阳无别事,等风也等你