import './slider.css';
import './btn.css';
import Slider from './module';
const slider = new Slider(document.querySelector('.slider'), {
initialIndex: 1,
animation: true,
// 切换速度,单位 ms
speed: 300,
// 自动切换,单位 ms
autoplay: 1000
});
const bannerEl = document.getElementById('banner');
const leftbtnEl = document.getElementById('leftbtn');
const rightbtnEl = document.getElementById('rightbtn');
leftbtnEl.addEventListener(
'click',
() => {
slider.prev();
},
false
);
rightbtnEl.addEventListener(
'click',
() => {
slider.next();
},
false
);
bannerEl.addEventListener(
'mouseenter',
() => {
slider.pause();
},
false
);
bannerEl.addEventListener(
'mouseleave',
() => {
slider.autoplay();
},
false
);
// css
import './css/bundle.css';
// 公共的css样式
import 'styles/base.css';
import 'styles/reset.css';
import 'styles/layer_out.css';
//js
import './js/backtotop';
// 公共组件可以取路径别名
import 'components/topbar';
import 'components/min-nav';
import 'components/header-con';
import 'components/footer-nav';
import 'components/bottom-bar';
// 单独组件自己找自己的路径
import './components/slider';
import './components/menu';
import './components/jjzyx';
import './components/fav-ad';
import './components/xxsw';
import './components/ddwl';
import './components/tsddty';
import './components/zsj';
import './components/gt';
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星