- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用光滑 slider 创建了 slider 。我遇到的问题是在线断点工作正常的宽度。
但是,当我以正常方式写入 html file 时,相同的代码不起作用。谁能帮我这个。从检查中检查并查看正常代码和在线代码。
let slider = $(".slider");
slider.not('.slick-initialized').slick({
autoplay: false,
infinite: true,
vertical: false,
dots: true,
arrows: true,
slidesToShow: 1,
slidesToScroll: 1,
customPaging: function(slider, i) {},
responsive: [{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
vertical: false,
},
}, {
breakpoint: 600,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
vertical: false,
},
}, {
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
vertical: false,
},
}]
});
.slide-img {
text-align: center;
height: 150px;
width: auto;
}
.main-title {
font-size: 18px;
line-height: 24px;
margin-bottom: 12px;
}
.description {
font-size: 12px;
line-height: 18px;
margin-bottom: 18px;
}
.know-more {
font-size: 14px;
font-weight: bold;
color: #fff;
line-height: 20px;
text-decoration: none;
}
.know-more:focus {
outline: none;
}
.know-more img {
display: inline-block;
margin-left: 8px;
margin-bottom: -2px;
width: 14px;
height: 14px !important;
}
.text-xs-center {
text-align: center !important;
padding: 40px 15px !important;
}
.slider {
width: auto;
margin: 30px;
}
.slider .slick-slide {
background: #292e3e;
color: white;
padding: 40px 0;
font-size: 30px;
font-family: "Arial", "Helvetica";
text-align: center;
}
.slider .slick-prev:before,
.slider .slick-next:before {
color: #292e3e;
}
.slider .slick-slide:nth-child(odd) {
background: #57C09F;
}
.slick-slide img {
display: initial !important;
}
.slick-dots li {
display: inline-block;
width: 6px !important;
height: 6px !important;
background: #cccccc;
-webkit-transition: all 0.5s;
transition: all 0.5s;
-webkit-border-radius: 50%;
border-radius: 50%;
margin: 0 6px;
cursor: pointer;
position: relative;
}
.slick-dots li.slick-active {
background: #26d400;
width: 31px !important;
height: 6px !important;
border-radius: 4px;
border: none;
}
<link rel='stylesheet' href='https://rawgit.com/kenwheeler/slick/master/slick/slick.css'>
<link rel='stylesheet' href='https://rawgit.com/kenwheeler/slick/master/slick/slick-theme.css'>
<section class="slider">
<div class="text-xs-center">
<img class="slide-img" src="https://webfeb.in/wp-content/uploads/2016/11/logo-design-for-it-company.jpg">
<h2 class="main-title">HEAD TITLE 1</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
<div class="text-xs-center">
<img class="slide-img" src="https://cdn5.vectorstock.com/i/1000x1000/08/04/umbrella-protection-company-logo-concept-vector-2740804.jpg">
<h2 class="main-title">HEAD TITLE 2</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
<div class="text-xs-center">
<img class="slide-img" src="https://webfeb.in/wp-content/uploads/2017/05/digital-world-design.jpg">
<h2 class="main-title">HEAD TITLE 3</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
<div class="text-xs-center">
<img class="slide-img" src="https://previews.123rf.com/images/mahabiru/mahabiru1601/mahabiru160100044/50770590-business-corporate-letter-d-logo-design-vector-.jpg">
<h2 class="main-title">HEAD TITLE 4</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
<div class="text-xs-center">
<img class="slide-img" src="https://previews.123rf.com/images/hartgraphic/hartgraphic1712/hartgraphic171200016/92243101-digital-cube-icon-.jpg">
<h2 class="main-title">HEAD TITLE 5</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
<div class="text-xs-center">
<img class="slide-img" src="https://previews.123rf.com/images/putracetol/putracetol1701/putracetol170100016/69776339-digital-cube-logo.jpg">
<h2 class="main-title">HEAD TITLE 6</h2>
<h3 class="description">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</h3>
<a class="know-more" href="#">LEARN MORE<img src="https://www.kindpng.com/picc/m/141-1415295_red-right-arrow-hd-png-download.png" alt=""></a>
</div>
</section>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>
<script src='https://kenwheeler.github.io/slick/slick/slick.js'></script>
最佳答案
我也遇到了同样的问题。经过一番调试,我发现 HTML 中的尺寸大于屏幕宽度。将以下行添加到标题部分解决了我的问题:
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
关于javascript - 光滑 slider 响应断点宽度不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61102389/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!