- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以将我的第一张幻灯片中的图像“固定”
保持在适当的位置,让第二张幻灯片图像覆盖它?
目前,幻灯片 2 替换了幻灯片 1,但我想始终保留原始图像,让幻灯片 2 和后续幻灯片覆盖它。
演示: https://jsfiddle.net/12dd5j1s/
jQuery(document).ready(function($){
var slidesWrapper = $('.cd-hero-slider');
//check if a .cd-hero-slider exists in the DOM
if ( slidesWrapper.length > 0 ) {
var primaryNav = $('.cd-primary-nav'),
sliderNav = $('.cd-slider-nav'),
navigationMarker = $('.cd-marker'),
slidesNumber = slidesWrapper.children('li').length,
visibleSlidePosition = 0,
autoPlayId,
autoPlayDelay = 5000;
//upload videos (if not on mobile devices)
uploadVideo(slidesWrapper);
//autoplay slider
setAutoplay(slidesWrapper, slidesNumber, autoPlayDelay);
//on mobile - open/close primary navigation clicking/tapping the menu icon
primaryNav.on('click', function(event){
if($(event.target).is('.cd-primary-nav')) $(this).children('ul').toggleClass('is-visible');
});
//change visible slide
sliderNav.on('click', 'li', function(event){
event.preventDefault();
var selectedItem = $(this);
if(!selectedItem.hasClass('selected')) {
// if it's not already selected
var selectedPosition = selectedItem.index(),
activePosition = slidesWrapper.find('li.selected').index();
if( activePosition < selectedPosition) {
nextSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, selectedPosition);
} else {
prevSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, selectedPosition);
}
//this is used for the autoplay
visibleSlidePosition = selectedPosition;
updateSliderNavigation(sliderNav, selectedPosition);
updateNavigationMarker(navigationMarker, selectedPosition+1);
//reset autoplay
setAutoplay(slidesWrapper, slidesNumber, autoPlayDelay);
}
});
}
function nextSlide(visibleSlide, container, pagination, n){
visibleSlide.removeClass('selected from-left from-right').addClass('is-moving').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
visibleSlide.removeClass('is-moving');
});
container.children('li').eq(n).addClass('selected from-right').prevAll().addClass('move-left');
checkVideo(visibleSlide, container, n);
}
function prevSlide(visibleSlide, container, pagination, n){
visibleSlide.removeClass('selected from-left from-right').addClass('is-moving').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
visibleSlide.removeClass('is-moving');
});
container.children('li').eq(n).addClass('selected from-left').removeClass('move-left').nextAll().removeClass('move-left');
checkVideo(visibleSlide, container, n);
}
function updateSliderNavigation(pagination, n) {
var navigationDot = pagination.find('.selected');
navigationDot.removeClass('selected');
pagination.find('li').eq(n).addClass('selected');
}
function setAutoplay(wrapper, length, delay) {
if(wrapper.hasClass('autoplay')) {
clearInterval(autoPlayId);
autoPlayId = window.setInterval(function(){autoplaySlider(length)}, delay);
}
}
function autoplaySlider(length) {
if( visibleSlidePosition < length - 1) {
nextSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, visibleSlidePosition + 1);
visibleSlidePosition +=1;
} else {
prevSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, 0);
visibleSlidePosition = 0;
}
updateNavigationMarker(navigationMarker, visibleSlidePosition+1);
updateSliderNavigation(sliderNav, visibleSlidePosition);
}
function uploadVideo(container) {
container.find('.cd-bg-video-wrapper').each(function(){
var videoWrapper = $(this);
if( videoWrapper.is(':visible') ) {
// if visible - we are not on a mobile device
var videoUrl = videoWrapper.data('video'),
video = $('<video loop><source src="'+videoUrl+'.mp4" type="video/mp4" /><source src="'+videoUrl+'.webm" type="video/webm" /></video>');
video.appendTo(videoWrapper);
// play video if first slide
if(videoWrapper.parent('.cd-bg-video.selected').length > 0) video.get(0).play();
}
});
}
function checkVideo(hiddenSlide, container, n) {
//check if a video outside the viewport is playing - if yes, pause it
var hiddenVideo = hiddenSlide.find('video');
if( hiddenVideo.length > 0 ) hiddenVideo.get(0).pause();
//check if the select slide contains a video element - if yes, play the video
var visibleVideo = container.children('li').eq(n).find('video');
if( visibleVideo.length > 0 ) visibleVideo.get(0).play();
}
function updateNavigationMarker(marker, n) {
marker.removeClassPrefix('item').addClass('item-'+n);
}
$.fn.removeClassPrefix = function(prefix) {
//remove all classes starting with 'prefix'
this.each(function(i, el) {
var classes = el.className.split(" ").filter(function(c) {
return c.lastIndexOf(prefix, 0) !== 0;
});
el.className = $.trim(classes.join(" "));
});
return this;
};
});
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, main {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* --------------------------------
Primary style
-------------------------------- */
*, *::after, *::before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
font-size: 62.5%;
}
body {
font-size: 1.6rem;
font-family: "Open Sans", sans-serif;
color: #2c343b;
background-color: #f2f2f2;
}
a {
color: #d44457;
text-decoration: none;
}
img {
max-width: 130%;
}
/* --------------------------------
Main Components
-------------------------------- */
.cd-header {
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 50px;
background-color: #21272c;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@media only screen and (min-width: 768px) {
.cd-header {
height: 70px;
background-color: transparent;
}
}
#cd-logo {
float: left;
margin: 13px 0 0 5%;
}
#cd-logo img {
display: block;
}
@media only screen and (min-width: 300px) {
#cd-logo {
margin: 23px 0 0 5%;
}
}
.cd-primary-nav {
/* mobile first - navigation hidden by default, triggered by tap/click on navigation icon */
float: right;
margin-right: 5%;
width: 44px;
height: 100%;
background: url("../assets/cd-icon-menu.svg") no-repeat center center;
}
.cd-primary-nav ul {
position: absolute;
top: 0;
left: 0;
width: 100%;
-webkit-transform: translateY(-100%);
-moz-transform: translateY(-100%);
-ms-transform: translateY(-100%);
-o-transform: translateY(-100%);
transform: translateY(-100%);
}
.cd-primary-nav ul.is-visible {
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
-webkit-transform: translateY(50px);
-moz-transform: translateY(50px);
-ms-transform: translateY(50px);
-o-transform: translateY(50px);
transform: translateY(50px);
}
.cd-primary-nav a {
display: block;
height: 50px;
line-height: 50px;
padding-left: 5%;
background: #21272c;
border-top: 1px solid #333c44;
color: #ffffff;
}
@media only screen and (min-width: 768px) {
.cd-primary-nav {
/* reset navigation values */
width: auto;
height: auto;
background: none;
}
.cd-primary-nav ul {
position: static;
width: auto;
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
line-height: 70px;
}
.cd-primary-nav ul.is-visible {
-webkit-transform: translateY(0);
-moz-transform: translateY(0);
-ms-transform: translateY(0);
-o-transform: translateY(0);
transform: translateY(0);
}
.cd-primary-nav li {
display: inline-block;
margin-left: 1em;
}
.cd-primary-nav a {
display: inline-block;
height: auto;
font-weight: 600;
line-height: normal;
background: transparent;
padding: .6em 1em;
border-top: none;
}
}
/* --------------------------------
Slider
-------------------------------- */
.cd-hero {
position: relative;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.cd-hero-slider {
position: relative;
height: 360px;
overflow: hidden;
}
.cd-hero-slider li {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
-ms-transform: translateX(100%);
-o-transform: translateX(100%);
transform: translateX(100%);
}
.cd-hero-slider li.selected {
/* this is the visible slide */
position: relative;
-webkit-transform: translateX(0);
-moz-transform: translateX(0);
-ms-transform: translateX(0);
-o-transform: translateX(0);
transform: translateX(0);
}
.cd-hero-slider li.move-left {
/* slide hidden on the left */
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
-ms-transform: translateX(-100%);
-o-transform: translateX(-100%);
transform: translateX(-100%);
}
.cd-hero-slider li.is-moving, .cd-hero-slider li.selected {
/* the is-moving class is assigned to the slide which is moving outside the viewport */
-webkit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
transition: transform 0.5s;
}
@media only screen and (min-width: 768px) {
.cd-hero-slider {
height: 500px;
}
}
@media only screen and (min-width: 1170px) {
.cd-hero-slider {
height: 680px;
}
}
/* --------------------------------
Single slide style
-------------------------------- */
.cd-hero-slider li {
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
background-image: url(../assets/oneback2.jpg);
}
.cd-hero-slider li:first-of-type {
background-color: #2c343b;
}
.cd-hero-slider li:nth-of-type(2) {
background-color: #3d4952;
}
.cd-hero-slider li:nth-of-type(3) {
background-color: #5f2322;
}
.cd-hero-slider li:nth-of-type(4) {
background-color: #05132f;
}
.cd-hero-slider li:nth-of-type(5) {
background-color: #2c343b;
}
.cd-hero-slider .cd-full-width,
.cd-hero-slider .cd-half-width {
position: absolute;
width: 100%;
height: 100%;
z-index: 1;
left: 0;
top: 0;
/* this padding is used to align the text */
padding-top: 100px;
text-align: center;
/* Force Hardware Acceleration in WebKit */
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
.cd-hero-slider .cd-img-container {
/* hide image on mobile device */
display: none;
}
.cd-hero-slider .cd-img-container img {
position: inherit;
left: 100%;
top: 50%;
bottom: auto;
right: auto;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
-o-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.cd-hero-slider .cd-bg-video-wrapper {
/* hide video on mobile device */
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
.cd-hero-slider .cd-bg-video-wrapper video {
/* you won't see this element in the html, but it will be injected using js */
display: block;
min-height: 100%;
min-width: 100%;
max-width: none;
height: auto;
width: auto;
position: absolute;
left: 50%;
top: 50%;
bottom: auto;
right: auto;
-webkit-transform: translateX(-50%) translateY(-50%);
-moz-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
-o-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
}
.cd-hero-slider h2, .cd-hero-slider p {
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
line-height: 1.2;
margin: 0 auto 14px;
color: #ffffff;
width: 90%;
max-width: 400px;
}
.cd-hero-slider h2 {
font-size: 2.4rem;
}
.cd-hero-slider p {
font-size: 1.4rem;
line-height: 1.4;
}
.cd-hero-slider .cd-btn {
display: inline-block;
padding: 1.2em 1.4em;
margin-top: .8em;
background-color: rgba(212, 68, 87, 0.9);
font-size: 1.3rem;
font-weight: 700;
letter-spacing: 1px;
color: #ffffff;
text-transform: uppercase;
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.cd-hero-slider .cd-btn.secondary {
background-color: rgba(22, 26, 30, 0.8);
}
.cd-hero-slider .cd-btn:nth-of-type(2) {
margin-left: 1em;
}
.no-touch .cd-hero-slider .cd-btn:hover {
background-color: #d44457;
}
.no-touch .cd-hero-slider .cd-btn.secondary:hover {
background-color: #161a1e;
}
@media only screen and (min-width: 768px) {
.cd-hero-slider li:nth-of-type(2) {
background-image: none;
}
.cd-hero-slider li:nth-of-type(3) {
background-image: none;
}
.cd-hero-slider li:nth-of-type(4) {
background-image: none;
}
.cd-hero-slider .cd-full-width,
.cd-hero-slider .cd-half-width {
padding-top: 150px;
}
.cd-hero-slider .cd-bg-video-wrapper {
display: block;
}
.cd-hero-slider .cd-half-width {
width: 45%;
}
.cd-hero-slider .cd-half-width:first-of-type {
left: 5%;
}
.cd-hero-slider .cd-half-width:nth-of-type(2) {
right: 5%;
left: auto;
}
.cd-hero-slider .cd-img-container {
display: block;
}
.cd-hero-slider h2, .cd-hero-slider p {
max-width: 520px;
}
.cd-hero-slider h2 {
font-size: 2.4em;
font-weight: 300;
}
.cd-hero-slider .cd-btn {
font-size: 1.4rem;
}
}
@media only screen and (min-width: 1170px) {
.cd-hero-slider .cd-full-width,
.cd-hero-slider .cd-half-width {
padding-top: 220px;
}
.cd-hero-slider h2, .cd-hero-slider p {
margin-bottom: 20px;
}
.cd-hero-slider h2 {
font-size: 3.2em;
}
.cd-hero-slider p {
font-size: 1.6rem;
}
}
/* --------------------------------
Single slide animation
-------------------------------- */
@media only screen and (min-width: 768px) {
.cd-hero-slider .cd-half-width {
opacity: 0;
-webkit-transform: translateX(40px);
-moz-transform: translateX(40px);
-ms-transform: translateX(40px);
-o-transform: translateX(40px);
transform: translateX(40px);
}
.cd-hero-slider .move-left .cd-half-width {
-webkit-transform: translateX(-40px);
-moz-transform: translateX(-40px);
-ms-transform: translateX(-40px);
-o-transform: translateX(-40px);
transform: translateX(-40px);
}
.cd-hero-slider .selected .cd-half-width {
/* this is the visible slide */
opacity: 1;
-webkit-transform: translateX(0);
-moz-transform: translateX(0);
-ms-transform: translateX(0);
-o-transform: translateX(0);
transform: translateX(0);
}
.cd-hero-slider .is-moving .cd-half-width {
/* this is the slide moving outside the viewport
wait for the end of the transition on the <li> parent before set opacity to 0 and translate to 40px/-40px */
-webkit-transition: opacity 0s 0.5s, -webkit-transform 0s 0.5s;
-moz-transition: opacity 0s 0.5s, -moz-transform 0s 0.5s;
transition: opacity 0s 0.5s, transform 0s 0.5s;
}
.cd-hero-slider li.selected.from-left .cd-half-width:nth-of-type(2),
.cd-hero-slider li.selected.from-right .cd-half-width:first-of-type {
/* this is the selected slide - different animation if it's entering from left or right */
-webkit-transition: opacity 0.4s 0.2s, -webkit-transform 0.5s 0.2s;
-moz-transition: opacity 0.4s 0.2s, -moz-transform 0.5s 0.2s;
transition: opacity 0.4s 0.2s, transform 0.5s 0.2s;
}
.cd-hero-slider li.selected.from-left .cd-half-width:first-of-type,
.cd-hero-slider li.selected.from-right .cd-half-width:nth-of-type(2) {
/* this is the selected slide - different animation if it's entering from left or right */
-webkit-transition: opacity 0.4s 0.4s, -webkit-transform 0.5s 0.4s;
-moz-transition: opacity 0.4s 0.4s, -moz-transform 0.5s 0.4s;
transition: opacity 0.4s 0.4s, transform 0.5s 0.4s;
}
.cd-hero-slider .cd-full-width h2,
.cd-hero-slider .cd-full-width p,
.cd-hero-slider .cd-full-width .cd-btn {
opacity: 0;
-webkit-transform: translateX(100px);
-moz-transform: translateX(100px);
-ms-transform: translateX(100px);
-o-transform: translateX(100px);
transform: translateX(100px);
}
.cd-hero-slider .move-left .cd-full-width h2,
.cd-hero-slider .move-left .cd-full-width p,
.cd-hero-slider .move-left .cd-full-width .cd-btn {
opacity: 0;
-webkit-transform: translateX(-100px);
-moz-transform: translateX(-100px);
-ms-transform: translateX(-100px);
-o-transform: translateX(-100px);
transform: translateX(-100px);
}
.cd-hero-slider .selected .cd-full-width h2,
.cd-hero-slider .selected .cd-full-width p,
.cd-hero-slider .selected .cd-full-width .cd-btn {
/* this is the visible slide */
opacity: 1;
-webkit-transform: translateX(0);
-moz-transform: translateX(0);
-ms-transform: translateX(0);
-o-transform: translateX(0);
transform: translateX(0);
}
.cd-hero-slider li.is-moving .cd-full-width h2,
.cd-hero-slider li.is-moving .cd-full-width p,
.cd-hero-slider li.is-moving .cd-full-width .cd-btn {
/* this is the slide moving outside the viewport
wait for the end of the transition on the li parent before set opacity to 0 and translate to 100px/-100px */
-webkit-transition: opacity 0s 0.5s, -webkit-transform 0s 0.5s;
-moz-transition: opacity 0s 0.5s, -moz-transform 0s 0.5s;
transition: opacity 0s 0.5s, transform 0s 0.5s;
}
.cd-hero-slider li.selected h2 {
-webkit-transition: opacity 0.4s 0.2s, -webkit-transform 0.5s 0.2s;
-moz-transition: opacity 0.4s 0.2s, -moz-transform 0.5s 0.2s;
transition: opacity 0.4s 0.2s, transform 0.5s 0.2s;
}
.cd-hero-slider li.selected p {
-webkit-transition: opacity 0.4s 0.3s, -webkit-transform 0.5s 0.3s;
-moz-transition: opacity 0.4s 0.3s, -moz-transform 0.5s 0.3s;
transition: opacity 0.4s 0.3s, transform 0.5s 0.3s;
}
.cd-hero-slider li.selected .cd-btn {
-webkit-transition: opacity 0.4s 0.4s, -webkit-transform 0.5s 0.4s, background-color 0.2s 0s;
-moz-transition: opacity 0.4s 0.4s, -moz-transform 0.5s 0.4s, background-color 0.2s 0s;
transition: opacity 0.4s 0.4s, transform 0.5s 0.4s, background-color 0.2s 0s;
}
}
/* --------------------------------
Slider navigation
-------------------------------- */
.cd-slider-nav {
position: absolute;
width: 100%;
bottom: 0;
z-index: 2;
text-align: center;
height: 55px;
background-color: rgba(0, 1, 1, 0.5);
}
.cd-slider-nav nav, .cd-slider-nav ul, .cd-slider-nav li, .cd-slider-nav a {
height: 100%;
}
.cd-slider-nav nav {
display: inline-block;
position: relative;
}
.cd-slider-nav .cd-marker {
position: absolute;
bottom: 0;
left: 0;
width: 60px;
height: 100%;
color: #d44457;
background-color: #ffffff;
box-shadow: inset 0 2px 0 currentColor;
-webkit-transition: -webkit-transform 0.2s, box-shadow 0.2s;
-moz-transition: -moz-transform 0.2s, box-shadow 0.2s;
transition: transform 0.2s, box-shadow 0.2s;
}
.cd-slider-nav .cd-marker.item-2 {
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
-ms-transform: translateX(100%);
-o-transform: translateX(100%);
transform: translateX(100%);
}
.cd-slider-nav .cd-marker.item-3 {
-webkit-transform: translateX(200%);
-moz-transform: translateX(200%);
-ms-transform: translateX(200%);
-o-transform: translateX(200%);
transform: translateX(200%);
}
.cd-slider-nav .cd-marker.item-4 {
-webkit-transform: translateX(300%);
-moz-transform: translateX(300%);
-ms-transform: translateX(300%);
-o-transform: translateX(300%);
transform: translateX(300%);
}
.cd-slider-nav .cd-marker.item-5 {
-webkit-transform: translateX(400%);
-moz-transform: translateX(400%);
-ms-transform: translateX(400%);
-o-transform: translateX(400%);
transform: translateX(400%);
}
.cd-slider-nav ul::after {
clear: both;
content: "";
display: table;
}
.cd-slider-nav li {
display: inline-block;
width: 60px;
float: left;
}
.cd-slider-nav li.selected a {
color: #2c343b;
}
.no-touch .cd-slider-nav li.selected a:hover {
background-color: transparent;
}
.cd-slider-nav a {
display: block;
position: relative;
padding-top: 35px;
font-size: 1rem;
font-weight: 700;
color: #a8b4be;
-webkit-transition: background-color 0.2s;
-moz-transition: background-color 0.2s;
transition: background-color 0.2s;
}
.cd-slider-nav a::before {
content: '';
position: absolute;
width: 24px;
height: 24px;
top: 8px;
left: 50%;
right: auto;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
-o-transform: translateX(-50%);
transform: translateX(-50%);
background: url(../assets/cd-icon-navigation.svg) no-repeat 0 0;
}
.no-touch .cd-slider-nav a:hover {
background-color: rgba(0, 1, 1, 0.5);
}
.cd-slider-nav li:first-of-type a::before {
background-position: 0 0;
}
.cd-slider-nav li.selected:first-of-type a::before {
background-position: 0 -24px;
}
.cd-slider-nav li:nth-of-type(2) a::before {
background-position: -24px 0;
}
.cd-slider-nav li.selected:nth-of-type(2) a::before {
background-position: -24px -24px;
}
.cd-slider-nav li:nth-of-type(3) a::before {
background-position: -48px 0;
}
.cd-slider-nav li.selected:nth-of-type(3) a::before {
background-position: -48px -24px;
}
.cd-slider-nav li:nth-of-type(4) a::before {
background-position: -72px 0;
}
.cd-slider-nav li.selected:nth-of-type(4) a::before {
background-position: -72px -24px;
}
.cd-slider-nav li:nth-of-type(5) a::before {
background-position: -96px 0;
}
.cd-slider-nav li.selected:nth-of-type(5) a::before {
background-position: -96px -24px;
}
@media only screen and (min-width: 768px) {
.cd-slider-nav {
height: 80px;
}
.cd-slider-nav .cd-marker,
.cd-slider-nav li {
width: 95px;
}
.cd-slider-nav a {
padding-top: 48px;
font-size: 1.1rem;
text-transform: uppercase;
}
.cd-slider-nav a::before {
top: 18px;
}
}
/* --------------------------------
Main content
-------------------------------- */
.cd-main-content {
width: 90%;
max-width: 768px;
margin: 0 auto;
padding: 2em 0;
}
.cd-main-content p {
font-size: 1.4rem;
line-height: 1.8;
color: #999999;
margin: 2em 0;
}
@media only screen and (min-width: 1170px) {
.cd-main-content {
padding: 3em 0;
}
.cd-main-content p {
font-size: 1.6rem;
}
}
/* --------------------------------
Javascript disabled
-------------------------------- */
.no-js .cd-hero-slider li {
display: none;
}
.no-js .cd-hero-slider li.selected {
display: block;
}
.no-js .cd-slider-nav {
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<section class="cd-hero">
<ul class="cd-hero-slider autoplay">
<li class="selected">
<div class="cd-half-width cd-img-container">
<img src="https://placeholdit.imgix.net/~text?txtsize=83&txt=1000%C3%97780&w=1000&h=780" alt="tech 1">
</div> <!-- .cd-full-width -->
</li>
<li>
<div class="cd-half-width cd-img-container">
<img src="http://lorempixel.com/1000/780/sports" alt="tech 1">
</div> <!-- .cd-half-width.cd-img-container -->
</li>
</ul> <!-- .cd-hero-slider -->
</section> <!-- .cd-hero -->
最佳答案
<style type="text/css">
.cd-hero-slider {
height: 680px;
background: url(../assets/onelogo.png) center center no-repeat;
}
.cd-hero-slider li:first-of-type, .cd-hero-slider li:nth-of-type(2), .cd-hero-slider li:nth-of-type(3),.cd-hero-slider li:nth-of-type(4) {
background:transparent;
}
</style>
关于javascript - 将第一张幻灯片图像保持在固定位置 - Hero Slider jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39867372/
我最近试图在 firebase fcm 中添加,但它没有工作,只是导致了几个错误,所以我将所有内容回滚到原始运行代码,但在此过程中升级了 flutter ...因为 v1.3.10 英雄不能包含其子层
Hero Search {{hero.name}}
在 Angular 教程中 https://angular.io/tutorial/toh-pt1#selector ,我不明白这句话:“CSS 元素选择器,‘app-heroes’,匹配在父组件模板
我被卡住了on the third step of the Angular tour of heroes tutorial ,上次我检查时,在 Angular 2 和 4 中,这个解决方案有效。从那以
我正在从 angular tutorial 学习 angular4 .下面是一个从服务函数中获取英雄的函数: @Injectable() export class HeroService {
已更新。 我正在关注 Angular2 教程 https://angular.io/docs/ts/latest/tutorial/toh-pt4.html 这里是从heres.component.t
本文整理了Java中heros.ZeroedFlowFunctions类的一些代码示例,展示了ZeroedFlowFunctions类的具体用法。这些代码示例主要来源于Github/Stackover
在这段代码中,文本没有垂直居中放置在 div 上。我不明白,因为我给了职位 50%。对于图像,我不能给出我想要的自定义高度吗? 在我的照片上,顶部的蓝线是导航栏,不要介意。
我的游戏是横向卷轴游戏,因此英雄具有恒定的速度,每次更新都会设置为他的速度。当我用几个“盒子”组成一个楼层时,英雄停在第一个结束和第二个开始的地方。它们大小相同且位于同一 y 轴上,为什么会发生这种情
我想使用Hero框架。我没有从他们的文档中得到任何 pod 命令。我用过“英雄” pods 。它有效,但在安装和下载 pod 后,当尝试打开项目时,它说 Xcode 9 does not suppor
我不知道为什么 justify-self 对我的 .hero-content 不起作用。 我试图让我的 .hero-content 水平和垂直居中,它水平居中但垂直它仍然位于顶部。不确定该怎么做。 .
我想知道是否可以得到一些帮助。 我正在尝试创建一个 HERO,在这里您可以看到我是如何将它与 和 标签一起编写的 https://www.screencast.com/t/COOZ3dCy9l 在这里
我已将一个全屏背景视频和一些介绍文字放入主页的一个部分。现在我想继续将内容添加到主页的下半部分,但有些东西完全搞砸了。你可以明白我的意思: 我在要添加为视频下方新部分的新内容周围画了一个红圈。由于某种
我在主图上放置了几个标题标签。当我调整浏览器大小时,文本叠加会上下移动。关于如何将文本固定在英雄图片中间有什么想法吗? html:
我编写了一个 Android 应用程序,它使用蓝牙从外部传感器获取数据。它在索尼爱立信 XPERIA 上运行良好,但在 HTC Hero 上运行良好(它可以找到外部设备,但无法从中获取任何数据)我想知
我的游戏有一个有 4 个座位的摩天轮。每个座位都有一个平台,英雄可以在上面休息。当座位处于上升轨道时,英雄平静地留在平台上。 但是,当座椅处于向下轨迹时,Hero 会向上/向下移动一点。 我已经尝试了
我正在尝试控制 GoPro Hero 3 摄像机。在网上找了个图书馆:https://github.com/r1pper/GoPro.Hero从我读到的内容来看,这是一个不错的图书馆。但是,当我尝试与
我有一个带有文本的按钮,当我按下按钮时,具有相同文本的文本小部件会添加到同一页面。 我想在它们之间添加类似 Hero 的动画。 我想我需要的是 SlideTransition,但我不知道如何从一个小部
我在 PageView 的一页中有一个图像。当我转到它时,我想将此图像动画到下一页,有点像在导航器页面转换中使用英雄动画时。任何想法如何实现? 最佳答案 为了实现类似于英雄动画的动画。基本上我们将实现
“英雄”一词是什么意思,为什么用它来命名网站/页面的“主要信息”? 具体来说,我想知道术语“英雄”或短语“英雄单位”是否是我设法错过的网页设计中使用的一些常见术语。 最佳答案 电影/电视 Prop 设
我是一名优秀的程序员,十分优秀!