1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- $(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 '<div class="' + className + '">' + text + '</div>';
- },
- }
- });
- $('#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);
- });
- });
|