400-806-0087
您的当前位置:主页 > 常见问题> 百度推广 > 正文

济南百度营销推广-济南百度营销推广助力企业高效引流与获客

时间:2025-08-05 16:15 所属栏目:百度推广 阅读数量: ()

YPE html>


 

 

 

  {$channel.seo_title|default=''}

 

    

 

 

 

 

 

 

 

 

 

 

 

        * {

            margin: 0;

            padding: 0;

            box-sizing: border-box;

        }

        

        body {

            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

            background: #f5f5f5;

            touch-action: pan-y;

        }

        

        .slider {

            width: 100%;

            height: 616px; /* 可根据需要调整高度 */

             max-height: 610px;

            position: relative;

            overflow: hidden;

        }

        

        .slider-container {

            display: flex;

            height: 100%;

            transition: transform 0.3s ease;

        }

        

        .slide {

            flex: 0 0 100%;

            height: 100%;

        }

        

        .slide img {

            width: 100%;

            height: 100%;

            object-fit: cover;

        }

        

        .slider-dots {

            position: absolute;

            bottom: 10px;

            left: 0;

            right: 0;

            display: flex;

            justify-content: center;

            gap: 6px;

        }

        

        .dot {

            width: 8px;

            height: 8px;

            border-radius: 50%;

            background: rgba(255,255,255,0.5);

            transition: all 0.3s;

        }

        

        .dot.active {

            background: #fff;

            transform: scale(1.2);

        }

   

   

        * {

            margin: 0;

            padding: 0;

            box-sizing: border-box;

        }

        

        .jian {

            width: 100%;

            height:660px;

          max-height: 390px;

            overflow: hidden;

            position: relative;

            margin: 0 auto;

        }

        

        .jian-container {

            display: flex;

            height: 100%;

            transition: transform 0.5s ease;

        }

        

        .jian-slide {

            min-width: 100%;

            height: 100%;

        }

        

        .jian-slide img {

            width: 100%;

            height: 100%;

            object-fit: cover;

        }

        

        .jian-dots {

            position: absolute;

            bottom: 10px;

            left: 0;

            right: 0;

            display: flex;

            justify-content: center;

            gap: 8px;

        }

        

        .jian-dot {

            width: 8px;

            height: 8px;

            border-radius: 50%;

            background: rgba(255,255,255,0.5);

            cursor: pointer;

            transition: all 0.3s;

        }

        

        .jian-dot.active {

            background: #fff;

            transform: scale(1.2);

        }

   




 




   

   

   


   

     

     

     

     


            

     



      

         

           

    

         

       

           

                轮播图1

           

           

                轮播图2

           

  

                       

       

        

       

           

           

           

       

   

      

     


   

    

   

      var swiper = new Swiper(".mySwiper", {

        pagination: {

          el: ".swiper-pagination",

        },

        

        loop: true,

        

        autoplay:{

            

        stopOnLastSlide: true,  

        },

        

      });

   

    

     

     

     

   

 

 

 

 

        document.addEventListener('DOMContentLoaded', function() {

            const slider = document.querySelector('.slider');

            const container = document.querySelector('.slider-container');

            const slides = document.querySelectorAll('.slide');

            const dots = document.querySelectorAll('.dot');

            

            let currentIndex = 0;

            let startX = 0;

            let isDragging = false;

            let autoPlayTimer;

            const slideCount = slides.length;

            

            // 更新轮播位置

            function updateSlider() {

                container.style.transform = `translateX(-${currentIndex * 100}%)`;

                

                // 更新指示点状态

                dots.forEach((dot, index) => {

                    dot.classList.toggle('active', index === currentIndex);

                });

            }

            

            // 下一张

            function nextSlide() {

                currentIndex = (currentIndex + 1) % slideCount;

                updateSlider();

            }

            

            // 跳转到指定slide

            function goToSlide(index) {

                currentIndex = index;

                updateSlider();

                resetAutoPlay();

            }

            

            // 自动轮播

            function startAutoPlay() {

                autoPlayTimer = setInterval(nextSlide, 3000);

            }

            

            // 重置自动轮播

            function resetAutoPlay() {

                clearInterval(autoPlayTimer);

                startAutoPlay();

            }

            

            // 触摸事件处理

            function handleTouchStart(e) {

                startX = e.touches[0].clientX;

                isDragging = true;

                clearInterval(autoPlayTimer);

            }

            

            function handleTouchMove(e) {

                if (!isDragging) return;

                e.preventDefault();

                

                const x = e.touches[0].clientX;

                const diff = startX - x;

                

                if (Math.abs(diff) > 50) {

                    isDragging = false;

                    if (diff > 0) {

                        nextSlide();

                    } else {

                        currentIndex = (currentIndex - 1 + slideCount) % slideCount;

                        updateSlider();

                    }

                }

            }

            

            function handleTouchEnd() {

                isDragging = false;

                resetAutoPlay();

            }

            

            // 初始化

            startAutoPlay();

            

            // 事件监听

            dots.forEach(dot => {

                dot.addEventListener('click', function() {

                    goToSlide(parseInt(this.dataset.index));

                });

            });

            

            // 触摸事件

            slider.addEventListener('touchstart', handleTouchStart, { passive: false });

            slider.addEventListener('touchmove', handleTouchMove, { passive: false });

            slider.addEventListener('touchend', handleTouchEnd);

            

            // 鼠标悬停暂停

            slider.addEventListener('mouseenter', () => clearInterval(autoPlayTimer));

            slider.addEventListener('mouseleave', resetAutoPlay);

        });

   

 

        document.addEventListener('DOMContentLoaded', function() {

            const jianSlider = document.querySelector('.jian');

            const jianContainer = document.querySelector('.jian-container');

            const jianSlides = document.querySelectorAll('.jian-slide');

            const jianDots = document.querySelectorAll('.jian-dot');

            

            let currentIndex = 0;

            let autoPlayTimer;

            

            // 更新轮播位置

            function updateSlider() {

                jianContainer.style.transform = `translateX(-${currentIndex * 100}%)`;

                

                // 更新指示点状态

                jianDots.forEach((dot, index) => {

                    dot.classList.toggle('active', index === currentIndex);

                });

            }

            

            // 下一张

            function nextSlide() {

                currentIndex = (currentIndex + 1) % jianSlides.length;

                updateSlider();

            }

            

            // 跳转到指定slide

            function goToSlide(index) {

                currentIndex = index;

                updateSlider();

                resetAutoPlay();

            }

            

            // 自动轮播

            function startAutoPlay() {

                autoPlayTimer = setInterval(nextSlide, 3000);

            }

            

            // 重置自动轮播

            function resetAutoPlay() {

                clearInterval(autoPlayTimer);

                startAutoPlay();

            }

            

            // 初始化

            startAutoPlay();

            

            // 点击指示点切换

            jianDots.forEach(dot => {

                dot.addEventListener('click', function() {

                    goToSlide(parseInt(this.dataset.index));

                });

            });

            

            // 触摸事件 - 简单实现

            let startX = 0;

            jianSlider.addEventListener('touchstart', (e) => {

                startX = e.touches[0].clientX;

                clearInterval(autoPlayTimer);

            });

            

            jianSlider.addEventListener('touchend', (e) => {

                const endX = e.changedTouches[0].clientX;

                const diff = startX - endX;

                

                if (Math.abs(diff) > 50) {

                    if (diff > 0) {

                        nextSlide();

                    } else {

                        currentIndex = (currentIndex - 1 + jianSlides.length) % jianSlides.length;

                        updateSlider();

                    }

                }

                resetAutoPlay();

            });

        });

   

 

百度营销

官网: https://so.baidu.com/ 可以登录此网站进行百度营销业务咨询,百度官方客服电话:400-806-0025;

本文非实时信息,实时信息以右侧客服提供的信息为准。

001.jpg

如果还想了解“济南百度营销推广-济南百度营销推广助力企业高效引流与获客”相关问题,可以联系官方电话,也可以点击屏幕上方的免费注册按钮

官方电话:400-806-0087(下方免费注册)

×

恭喜您提交成功

百度推广咨询员会在8:30-18:00以官方电话 进行回拨,请您注意接听,谢谢!

了解更多百度产品优势

×

百度营销 精准案例

400-806-0087

微信方案获取

在线咨询