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固定对个表格的表头时问题就出现了,首先说明系统的 ...
随机推荐
- 使用Github 当作自己个人博客的图床
使用Github 当作自己个人博客的图床 前提 本文前提: 我个人博客的草稿是存放在 github上的一个仓库 diarynote 截图存放的图片或者需要放在文章中图片,会固定存放在对应的文件夹中,我 ...
- springboot2.0整合redis的发布和订阅
1.Maven引用 <dependency> <groupId>org.springframework.boot</groupId> <artifactId& ...
- Usage of hdf2v3 and hdf2file
备注 修改Filetype,再执行hdf2file或hdf2tab,可以输出不同类型的数据.把Filetype设置成8,就是 Tecplot 格式的数据. <!DOCTYPE html PUBL ...
- 【java】Split函数踩坑记
先看一段代码: String line = "openssh|7.1"; String[] pkg = line.split("|"); System.out. ...
- LeetCode--046--全排列(java)
给定一个没有重复数字的序列,返回其所有可能的全排列. 示例: 输入: [1,2,3] 输出: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1 ...
- 前端JS编码规范
对初学者来说应该学习的JavaScript编码规范: 传送门: http://blog.chinaunix.net/xmlrpc.php?r=blog/article&uid=29292475 ...
- 170819-关于JSTL的知识点
1.JSTL(JSP Standard Tag Library) [1] JSTL简介 > JSTL是JSP的标准标签库 > JSTL为我们提供了一些常用的标签,供我们日常开发使用(if ...
- 转载:TypeError: Cannot read property 'compilation' of undefined vue 打包运行npm run build 报错
转载自:https://www.jianshu.com/p/3f8f60e01797 运行npm run build打包时,报错如下: 我的package.json如下: { ... " ...
- Elasticsearch6.5安装&&常见问题与答案解释
ElasticSearch是一个用Java开发的基于Lucene的搜索服务器.它可以提供一个分布式多用户能力的全文搜索引擎,基于RESTfulweb接口.现阶段它主要为Apache许可条款下的开放源码 ...
- Uva 12563 Jin Ge Jin Qu hao(01背包)
题意: 假定你在唱KTV,还剩下t秒时间.你决定接下来唱你最喜爱的n首歌(不包含劲歌金曲)中的一些歌曲.在时间结束之前再唱一个劲歌金曲.使得唱的歌的总曲目尽量多以及时间总长度. 输入保证所有n+1曲子 ...