在你的模板目录下template/模板名称/html/index的include.html里加入如下代码:
添加完成保存,苹果cms最好清楚下缓存,刷新前台查看效果
<style type="text/css"> .in { animation: ac 1s; } .out { position: fixed; bottom: 50%;(播放器位置) right: 1%;(播放器位置) z-index: 999; animation: an 0.5s; } </style> <script>window.jQuery || document.write('<script src="/macplus/js/jquery-1.11.0.min.js"></script>')</script> <script type="text/javascript"> window.onload=function(){ var ha = ($('.MacPlayer').find('table').offset().top + $('.MacPlayer').find('table').height()); $(window).scroll(function(){ if ( $(window).scrollTop() > ha ) { $('.MacPlayer').find('table').removeClass('in').addClass('out'); $('.MacPlayer').find('table').css('height','200px');(播放器大小) $('.MacPlayer').find('table').css('width','350px');(播放器大小) } else if ( $(window).scrollTop() < ha) { $('.MacPlayer').find('table').removeClass('out').addClass('in'); $('.MacPlayer').find('table').css('height','100%'); } }); }
有些模板如果在include.html添加没效果不行,就去找下播放器位置,很好找。毕竟主题文件都不多。

声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益 请联系邮箱:123456@qq.com 我们将配合处理!

原文地址:苹果cms播放器跟随移动方法发布于2025-11-18 00:00:00