在写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浏览器无反应,解决办法的更多相关文章

  1. swiper插件 纵向内容超出一屏解决办法

    1.css .swiper-slide { overflow: auto; } 2.js var swiper = new Swiper('.swiper-container', { directio ...

  2. 关于小米4电信4g刷入第三方ROM无信号解决办法

    from: http://www.yuwantb.com/xiaomi4-lineage-os.html   关于小米4电信4g刷入第三方ROM无信号解决办法 下载这个电信4g补丁包. 链接:http ...

  3. [vuejs] 终端npm run dev 不能自动打开浏览器运行项目解决办法

    终端执行: npm run dev 出现: I Your application is running here: http://localhost:8080 但并没有打开浏览器运行项目 解决办法: ...

  4. 关于调用notifyDataSetChanged刷新PullToRefreshListView列表无反应解决办法

    文章转载自:关于调用notifyDataSetChanged刷新PullToRefreshListView列表无反应解决办法 | TeachCourse

  5. 分享一个控制JS 浏览器缓存的解决办法。

     JS 缓存的问题一直都是我们又爱又恨的东西.也是我们比较头痛的问题, 一方面为了提高网站响应速度,减少服务器的负担,和节省带宽,将需要将静态资源缓存在客户端, 但是另一方面,当js 文件有改动的时候 ...

  6. selenium webdriver启动IE浏览器失败的解决办法

    通过selenium webdriver启动IE浏览器失败,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected ...

  7. postman插件部分Header设置无效的解决办法

    在使用chrome的postman插件模拟http请求的时候,碰到了设置的部分Headers无效的问题,比如说Referer设置后就无效,经过查询发现了问题原因,原因的具体说明参考postman官网的 ...

  8. MySQL删除数据库时无响应解决办法

    删除远程主机上MySQL中的一个数据库时,远程主机一直在响应,无法正常删除. 这个问题的解决办法如下:在远程主机上登录MySQL,执行show full processlist;观察state和inf ...

  9. jQuery,Table表头固定插件chromatable存在的问题及解决办法

    在最近的项目中需要将表格的表头固定,搜寻了大量的资料,发现chromatable插件还是比较方便的.但是当我在一个页面中多次使用 chromatable固定对个表格的表头时问题就出现了,首先说明系统的 ...

随机推荐

  1. python如何查看内存占用空间

    我们如何查看变量占用了多少内存空间呢 首先我们引用sys模块,在使用getsizeof()方法 import sys L = [x for x in range(10000)] print(sys.g ...

  2. cmd获取管理员权限等

    鼠标点点点的略过 可输入命令 runas /user:Administrator cmd 或 runas /noprofile /user:Administrator cmd Administrato ...

  3. 解决在mysql表中删除自增id数据后,再添加数据时,id不会自增1的问题

    https://blog.csdn.net/shaojunbo24/article/details/50036859 问题:mysql表中删除自增id数据后,再添加数据时,id不会紧接.比如:自增id ...

  4. LocalDateTime用法(jdk1.8 )

    前言 最近看别人项目源码,发现Java8新的日期时间API很方便强大,所以转载该入门介绍博客,记录一下. 使用新时间日期API的必要性 在java8以前,或许: 当你在做有关时间日期的操作时,你会想到 ...

  5. Python---基础---dict和set2

    2019-05-21 写一个程序来管理用户登陆系统的用户信息:登陆名字和密码,登陆用户账号建立后,已存在用户可以用登陆名字和密码重返系统,新用户不能用别人的用户名建立用户账号 ------------ ...

  6. [NOI2014] 魔法森林 (二分答案,并查集)

    本思路仅供参考,数据强一点应该该会被卡. 本蒟蒻没有打 \(link\) - \(cut\) - \(tree\) . 而是用暴力水了过去. 具体思路很简单,先二分最少的 \(a_i\) , 再在 \ ...

  7. Eclipse安装STS插件两种方式

    spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置.通过 ...

  8. dos编辑文件上传到unix系统多余^M删除方法

    linux上的文件sz到window编辑后多出^M, 方法一: 1.grep -anR '^M' filename |wc -l2.crontab -e 或vim filename3.:set ff  ...

  9. (转)Linux将命令添加到PATH中

    转:https://www.cnblogs.com/leibg/p/4479921.html Linux将命令添加到PATH中博客分类:linuxLinuxApacheBash 简单说PATH就是一组 ...

  10. Mac自带服务器的应用

    Mac OS下自带了apache,方便部署一些静态数据(html,css,js,xml,图片等数据) 一.系统默认路径 系统默认是隐藏apache安装目录的,但我们可以通过“命令行”或者“文件夹前往” ...