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固定对个表格的表头时问题就出现了,首先说明系统的 ...
随机推荐
- luogu4061 大吉大利,晚上吃鸡!
链接 最短路径\(dag\),一道好题. 题目大意:求一张图中满足下列要求的点对\((i,j)\)数量: 所有最短路径必定会经过 \(i\) 点和 \(j\) 点中的任意一点. 不存在一条最短路同时经 ...
- php7 mysqli连接mysql的几种方式
一.过程是方法 function connect(){ static $conn; if(!$conn){ $conn = mysqli_connect(DB_HOST,DB_USER,DB_PWD) ...
- web框架之初识Django
目录 一.web框架 1.1什么是web框架 1.2自制的简易web框架 1.3三大主流web框架简介 Django Flask Tornado 1.4动态网页与静态网页 二.初识Django框架 2 ...
- iText导出PDF(图片,水印,页眉,页脚)
项目需要导出PDF,导出的内容包含图片和文本,而且图片的数量不确定,在网上百度发现大家都在用iText,在官网发现可以把html转换为PDF,但是需要收费,那就只能自己写了. 在开始之前先在网上百度了 ...
- ht-5 treemap特性
(1)TreeMap类通过使用红黑树实现Map接口 (2)TreeMap提供按排序顺序存储键值对的有效手段,同时允许快速检索 (3)不同于散列映射,树映射保证它的元素按键的自然顺序升序排列 (4)Tr ...
- RedHat Linux6.4下安装apache服务
一.换yum 原因:安装apache2.4是需要安装apr . apr-util .pcre.httpd四个包, 在安装pcre包时会报错: configure: error: You need a ...
- ES命令
基础概念 Elasticsearch有几个核心概念.从一开始理解这些概念会对整个学习过程有莫大的帮助. 接近实时(NRT) Elasticsearch是一个接近实时的搜索平台.这意味 ...
- ubuntu python3相关
安装pip3 sudo apt install python3-pipsudo apt-get install python3-virtualenv sudo pip3 install virtual ...
- RESTful_基础知识
目录 目录 前言 RESTful REST原则 REST的Web原则 分层系统原则 RESTful的实现 SOA 面向服务的体系结构 RPC样式 Web服务 RPC的实现过程 SOAP 简单对象访问协 ...
- 【EWM系列】SAP EWM模块-部分流程图
公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[EWM系列]SAP EWM模块-部分流程图 ...