12345678910111213141516171819202122 |
- //DOM操作、Ajax
- import 'http://code.jquery.com/jquery-2.1.1.min.js';
- //轮播图
- import Swiper from 'https://unpkg.com/swiper@8/swiper-bundle.esm.browser.min.js';
- window.Swiper = Swiper;
- // bootstrap
- import 'https://cdn.staticfile.org/bootstrap/5.1.3/js/bootstrap.min.js';
- /**
- * 执行动画
- * @param ele 元素的选择器
- * @description 如果元素滚动至距离底部150px以上,添加css动效
- */
- window.showAnimate = function (ele,className){
- //监听页面滚动
- window.onscroll = function(event){
- if($(ele).offset().top <= $(window).height() + $(window).scrollTop() - 150){
- $(ele).addClass(className);
- }
- }
- }
|