swiper插件在ie浏览器无反应,解决办法
在写pc端页面时,用swiper插件发现在ie中用不了,百度下说是swiper从3以后向手机端发展,所以在pc端无响应。后来了解到,swiper3是专门针对移动端写的。如果想兼容IE8的话,应该引入swiper2.
也就是:idangerous.swiper.js
官网演示地址:http://2.swiper.com.cn/demo/
swiper2下载地址
链接:https://pan.baidu.com/s/1rWhJ1sCbcJVf4wfBRq_MYg 密码:qcuw
参考源码:
css:
<link rel="stylesheet" type="text/css" href="../css/idangerous.swiper.css" />
js
<script src="../js/idangerous.swiper.js" type="text/javascript" charset="utf-8"></script>
html
<div class="container-middle-solution">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>
<a class="title">网络解决方案</a>
</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>移动解决方案</div>
<div>我们做iOS应用开发,Android应用开发,混合APP开发以及移动应用市场咨询。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>网络解决方案</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>网络解决方案</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>网络解决方案</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>网络解决方案</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
<div class="swiper-slide">
<div class="container-middle-solution-pc">
<div>网络解决方案</div>
<div>我们做响应网站,网页开发,区块链开发,UI/UX设计,CRM解决方案,托管服务器解决方案。</div>
<div>
<img src="../img/index-pc.png">
</div>
</div>
</div>
</div>
<!-- Add Arrows -->
<!--<div class="icon-left">-->
<!--<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>-->
<a class="arrow-left" href="#"></a>
<a class="arrow-right" href="#"></a>
</div>
</div>
<script type="text/javascript">
var swiper = new Swiper('.swiper-container', {
// slidesPerView: "auto",
slidesPerView: 2,
spaceBetween: 0,
// mode: 'vertical', //2版本垂直滑动
// direction: 'vertical', //3版本垂直滑动
// pagination: {
// el: '.swiper-pagination',
// clickable: true,
// },
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
$('.arrow-left').on('click', function(e) {
e.preventDefault();
swiper.swipePrev();
})
$('.arrow-right').on('click', function(e) {
e.preventDefault();
swiper.swipeNext();
})
</script>
css样式问题
.swiper-container {
width: 100%;
padding-bottom: 100px;
}
/*.swiper-slide {
background-position: center;
background-size: cover;
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}*/
.swiper-button-prev,
.swiper-container-rtl .swiper-button-next {
background: url(../img/index-left.png) center center no-repeat;
background-size: 100%;
100%;
left: 52px;
right: auto;
top: 220px;
width: 54px;
height: 54px;
}
/*.arrow-left {
background: url(../img/index-left.png) center center no-repeat;
background-size: 100%;
100%;
left: 52px;
right: auto;
top: 220px;
width: 54px;
height: 54px;
}*/
.arrow-left {
background: url(../img/index-left.png) no-repeat left top;
position: absolute;
left: 36px;
top: 180px;
margin-top: -15px;
width: 54px;
height: 54px;
background-size: 100% 100%;
}
.arrow-right {
background: url(../img/index-right.png) no-repeat left bottom;
position: absolute;
/* right: 10px; */
left: 110px;
top: 180px;
margin-top: -15px;
width: 54px;
height: 54px;
background-size: 100% 100%;
}
效果

注意:在引用css2.0是有些样式之前写的4.0的,所以样式要改,要不然起冲突
写每个轮播之间的间距,要实现除了第一个之外,其他加上margin-left。那么在<div class="swiper-slide swiper-slides"> 里面,我这加的是swiper-slides
.swiper-slides:not(:first-child){
margin-left: 10px !important;
}
swiper插件在ie浏览器无反应,解决办法的更多相关文章
- swiper插件 纵向内容超出一屏解决办法
1.css .swiper-slide { overflow: auto; } 2.js var swiper = new Swiper('.swiper-container', { directio ...
- 关于小米4电信4g刷入第三方ROM无信号解决办法
from: http://www.yuwantb.com/xiaomi4-lineage-os.html 关于小米4电信4g刷入第三方ROM无信号解决办法 下载这个电信4g补丁包. 链接:http ...
- [vuejs] 终端npm run dev 不能自动打开浏览器运行项目解决办法
终端执行: npm run dev 出现: I Your application is running here: http://localhost:8080 但并没有打开浏览器运行项目 解决办法: ...
- 关于调用notifyDataSetChanged刷新PullToRefreshListView列表无反应解决办法
文章转载自:关于调用notifyDataSetChanged刷新PullToRefreshListView列表无反应解决办法 | TeachCourse
- 分享一个控制JS 浏览器缓存的解决办法。
JS 缓存的问题一直都是我们又爱又恨的东西.也是我们比较头痛的问题, 一方面为了提高网站响应速度,减少服务器的负担,和节省带宽,将需要将静态资源缓存在客户端, 但是另一方面,当js 文件有改动的时候 ...
- selenium webdriver启动IE浏览器失败的解决办法
通过selenium webdriver启动IE浏览器失败,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected ...
- postman插件部分Header设置无效的解决办法
在使用chrome的postman插件模拟http请求的时候,碰到了设置的部分Headers无效的问题,比如说Referer设置后就无效,经过查询发现了问题原因,原因的具体说明参考postman官网的 ...
- MySQL删除数据库时无响应解决办法
删除远程主机上MySQL中的一个数据库时,远程主机一直在响应,无法正常删除. 这个问题的解决办法如下:在远程主机上登录MySQL,执行show full processlist;观察state和inf ...
- jQuery,Table表头固定插件chromatable存在的问题及解决办法
在最近的项目中需要将表格的表头固定,搜寻了大量的资料,发现chromatable插件还是比较方便的.但是当我在一个页面中多次使用 chromatable固定对个表格的表头时问题就出现了,首先说明系统的 ...
随机推荐
- 触发写Redo Log的条件
参见:http://www.ixora.com.au/notes/redo_write_triggers.htm http://www.eygle.com/archives/2005/02/redoa ...
- Python获取exe文件版本
import time, datetime, re, subprocess, sys, os, win32net, win32api, win32con, win32netcon, win32secu ...
- hdu 4992 Primitive Roots 【求原根模板】
题目链接 大题流程: 判定是否有原根->求出最小原根->利用最小原根找出全部原根 #include<bits/stdc++.h> using namespace std; ty ...
- 17 安全字符串 System.Security.SecureString
- Dubbo学习-7-dubbo配置文件优先级
Dubbo配置加载流程 根据驱动方式的不同(比如Spring或裸API编程)配置形式上肯定会有所差异,具体参考XML配置.Annotation配置.API配置三篇文档.除了外围驱动方式上的差异,Dub ...
- php prev()函数 语法
php prev()函数 语法 作用:将内部指针指向数组中的上一个元素,并输出.直线电机选型 语法:prev(array) 参数: 参数 描述 array 必需.指定需要操作的数组. 说明:如果数组包 ...
- 第一周训练 | STL和基本数据结构
A - 圆桌问题: HDU - 4841 #include<iostream> #include<vector> #include<stdio.h> #includ ...
- html from表单异步处理
from表单异步处理. 简单处理方法: jQuery做异步提交表单处理, 通过$("#form").serialize()将表单元素的数据转化为字符串, 最后通过$.ajax()执 ...
- Gogs 安装 - 本地安装,容器安装
文章目录 安装 Gogs 本地安装 前提条件: 数据库 git 创建 git 用户 SSH 服务器 安装 升级 配置及运行 配置 运行 Gogs 服务 在线安装 Gogs 后台运行 gogs 通过 d ...
- 手撸红黑树-Red-Black Tree 入门
一.学习红黑树前的准备: 熟悉基础数据结构 了解二叉树概念 二.红黑树的规则和规则分析: 根节点是黑色的 所有叶子节点(Null)是黑色的,一般会认定节点下空节点全部为黑色 如果节点为红色,那么子节点 ...