JavaScript
9
Вклад в тег
function initSlider() {
new Swiper('.swiper', {
loop: false,
sped: 2400,
navigation:{
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
pagination: {
el: '.swiper-pagination',
clickable: true
},
breakpoints: {
// when window width is >= 320px
320: {
slidesPerView: 2,
spaceBetween: 20
},
// when window width is >= 480px
480: {
slidesPerView: 2,
spaceBetween: 30
},
// when window width is >= 1920px
1920: {
slidesPerView: 1,
spaceBetween: 60,
autoplay:false,
}
}
});
}
function detectDevice() {
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
// true for mobile device
initSlider();
}else{
// false for not mobile device
}
}
detectDevice();
display: flex
align-items: center
justify-content: center
document.body.style.overflow = 'hidden'
document.body.style.overflow = 'auto'
const body = document.body
//open modal
body.style.overflow = 'hidden'
//close modal
body.style.overflow = 'auto'
const gulp = require('gulp');
const ghPages = require('gulp-gh-pages');
gulp.task('deploy', function() {
return gulp.src('./dist/**/*')
.pipe(ghPages());
});