$(document).ready(function () {
var mySwiper = new Swiper('.swiper-container', {
autoplay: true, //可选选项,自动滑动
loop: true,
direction: 'horizontal',
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
pagination: {
el: '.swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
var text = index + 1;
return '
' + text + '
';
},
}
});
$('#example-navbar-collapse .dropdow_menu a').click(function (e) {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
console.log(target)
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 40
}, 900);
return false;
}
}
});
$(document).off('click.bs.dropdown.data-api');
$('.top').click(function (e) {
e.preventDefault();
$("body,html").animate({
scrollTop: 0
}, 500);
});
});