El truco principal por así llamarlo, es flotar las imágenes una junto a otra y ocultarlas mediante un overflow. Luego, mediante unos botones radio a modo de controles, se van aplicando unos márgenes negativos equivalentes a 0, 1, 2, 3 y 4 veces el 100% del ancho del contenedor y así es como se logra ir viendo las distintas imágenes. Cinco en este ejemplo.
Una transición hace simula el efecto slider y como comentan en la página, todo lo demás es estilo.
#slide2:checked ~ #slides .inner { margin-left:-100%; }
#slide3:checked ~ #slides .inner { margin-left:-200%; }
#slide4:checked ~ #slides .inner { margin-left:-300%; }
#slide5:checked ~ #slides .inner { margin-left:-400%; }
Gran ola
byBartolo Manzano
Pez
byArmando Bronca
Estilo libre
byDando T. Estopa
Vista de Río
byJohnny Melavo
En el arco
byElba Tracio
Aunque entiendo la mecánica no es un código que sea capaz de explicar completamente, así que sólo os daré las instrucciones justas y necesarias para que lo podáis instalar.
El fichero CSS completo es algo extenso, así que aquí lo dejo plegado. Lo que hay que hacer con él es copiarlo y pegarlo antes del cierre}/b:skin, en la parte de estilo. También podéisdescargarlo desde este enlace o desdeeste otro.
text-align: center;
margin: 0 auto;
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
#slider label, a {
color: #444444;
cursor: pointer;
text-decoration: none;
}
#slider label:hover, #slider a:hover {
color: #000 !important;
}
#slider label, #slider #active, #slider img { -moz-user-select:none;-webkit-user-select:none; }
#slider input {
display: none;
}
#slide1:checked ~ #slides .inner { margin-left:0; }
#slide2:checked ~ #slides .inner { margin-left:-100%; }
#slide3:checked ~ #slides .inner { margin-left:-200%; }
#slide4:checked ~ #slides .inner { margin-left:-300%; }
#slide5:checked ~ #slides .inner { margin-left:-400%; }
#overflow {
width: 100%;
overflow: hidden;
}
#slider article img {
width: 100%;
max-width:100% !important;
}
#slides .inner {
width: 500%;
line-height: 0;
}
#slides article {
width: 20%;
float: left;
}
/* Slider Styling */
/* Control Setup */
#controls {
margin: -25% 0 0 0;
width: 100%;
height: 50px;
}
#controls label {
display: none;
width: 50px;
height: 50px;
opacity: 0.3;
}
#active {
margin: 23% 0 0;
text-align: center;
}
#active label {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
display: inline-block;
width: 10px;
height: 10px;
background: #bbb;
}
#active label:hover {
background: #ccc;
border-color: #777 !important;
}
#controls label:hover {
opacity: 0.8;
}
#slide1:checked ~ #controls label:nth-child(2),
#slide2:checked ~ #controls label:nth-child(3),
#slide3:checked ~ #controls label:nth-child(4),
#slide4:checked ~ #controls label:nth-child(5),
#slide5:checked ~ #controls label:nth-child(1) {
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7EnxZAJoo3ynGLsQzirGRwR6KuKunkrLwEBQtSVQ1f8ihFmdEy2l6L3Xa_f1XEp5fNo3Th_8_k-KLdraIyS8vwNJS1Y-9vblSYsy4mKpgs06rRR8YKV_zqHUjOJDFm0r5YjSUKmxLjSE/s1600/nextrt.png') no-repeat;
float: right;
margin: 0 -70px 0 0;
display: block;
}
#slide1:checked ~ #controls label:nth-child(5),
#slide2:checked ~ #controls label:nth-child(1),
#slide3:checked ~ #controls label:nth-child(2),
#slide4:checked ~ #controls label:nth-child(3),
#slide5:checked ~ #controls label:nth-child(4) {
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnltt3aOTyRy89MZEFrvkstR6Sh4uJ2Ph3XOc8fPdPONt_KruqqJZhP3HNojBOPtuFx8OT7CDdOooGRk423TqxnIV4b-o3s0dKrwM2X2N2Y6ez7tZEIv52NvJz2yKzuvrnfNYfN1b-IQc/s1600/prevrt.png') no-repeat;
float: left;
margin: 0 0 0 -70px;
display: block;
}
#slide1:checked ~ #active label:nth-child(1),
#slide2:checked ~ #active label:nth-child(2),
#slide3:checked ~ #active label:nth-child(3),
#slide4:checked ~ #active label:nth-child(4),
#slide5:checked ~ #active label:nth-child(5) {
background: #333;
border-color: #333 !important;
}
/* Info Box */
#slider .info {
line-height: 20px;
margin: 0 0 -150%;
position: absolute;
font-style: italic;
padding: 30px 30px;
opacity: 0;
color: #000;
text-align: left;
}
#slider .info h3 {
color: #333;
margin: 0 0 5px;
font-weight: normal;
font-size: 22px;
font-style: normal;
}
/* Slider Styling */
#slides {
margin: 45px 0 0;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
box-shadow: 1px 1px 4px #666;
padding: 1%;
background: #fff;
background: rgb(252,255,244); /* Old browsers */
background: -moz-linear-gradient(top, rgba(252,255,244,1) 0%, rgba(219,218,201,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,255,244,1)), color-stop(100%,rgba(219,218,201,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(252,255,244,1) 0%,rgba(219,218,201,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(252,255,244,1) 0%,rgba(219,218,201,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(252,255,244,1) 0%,rgba(219,218,201,1) 100%); /* IE10+ */
background: linear-gradient(top, rgba(252,255,244,1) 0%,rgba(219,218,201,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#dbdac9',GradientType=0 ); /* IE6-9 */
}
/* Animation */
#slides .inner {
-webkit-transform: translateZ(0);
-webkit-transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
-moz-transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
-ms-transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
-o-transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000);
transition: all 800ms cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */
-webkit-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
-moz-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
-ms-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
-o-transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000);
transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */
}
#slider {
-webkit-transform: translateZ(0);
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
#controls label{
-webkit-transform: translateZ(0);
-webkit-transition: opacity 0.2s ease-out;
-moz-transition: opacity 0.2s ease-out;
-o-transition: opacity 0.2s ease-out;
transition: opacity 0.2s ease-out;
}
#slider #controls {
margin: -25% 0 0 15%;
width: 70%;
height: 50px;
}
#slider #controls label {
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
-o-transform: scale(0.8);
-ms-transform: scale(0.8);
transform: scale(0.8);
}
#slide1:checked ~ #slides article:nth-child(1) .info,
#slide2:checked ~ #slides article:nth-child(2) .info,
#slide3:checked ~ #slides article:nth-child(3) .info,
#slide4:checked ~ #slides article:nth-child(4) .info,
#slide5:checked ~ #slides article:nth-child(5) .info {
opacity: 1;
-webkit-transition: all 1s ease-out 0.6s;
-moz-transition: all 1s ease-out 0.6s;
-o-transition: all 1s ease-out 0.6s;
transition: all 1s ease-out 0.6s;
}
#slider .info, #controls, #slides, #active, #active label, .info h3, .desktop, .tablet, .mobile {
-webkit-transform: translateZ(0);
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
/* Responsive Styling */
@media only screen and (max-width: 850px) and (min-width: 450px) {
#slider #slides {
padding: 1% 0;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
#slider #active {
margin: 22% 0 0;
}
}
@media only screen and (max-width: 450px) {
#slider #controls {
margin: -28% 0 0 24%;
width: 50%;
height: 50px;
}
#slider #active {
margin: 23% 0 0;
}
#slider #slides {
padding: 1% 0;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
#slider #slides .info {
opacity: 0 !important;
}
#slider #controls label {
-moz-transform: scale(0.6);
-webkit-transform: scale(0.6);
-o-transform: scale(0.6);
-ms-transform: scale(0.6);
transform: scale(0.6);
}
}
Otra opción sería alojarlo en un servicio externo y luego hacer una llamada desde la plantilla mediante una de estas fórmulas:
Enlace a alojamiento externo desde plantilla. Insertar antes deb:skin![CDATA[/*:
Enlace a alojamiento externo desde un post (o desde plantilla, antes de/head:
@import url(FICHERO_ESTILO.CSS);
/style
Una vez que tenemos nuestro CSS ya sólo resta construir el visor en sí mismo mediante HTML. Esta sería la estructura. LosDIV INFO y su contenido son opciones:
input checked type="radio" name="slider" id="slide1" /
input type="radio" name="slider" id="slide2" /
input type="radio" name="slider" id="slide3" /
input type="radio" name="slider" id="slide4" /
input type="radio" name="slider" id="slide5" /
div id="slides"
div id="overflow"
div class="inner"
articlediv class="info"
h5Título/h5
a href="#"Autor/a/div
img src="URL_IMAGEN" /
/article
articlediv class="info"
h5Título/h5
a href="#"Autor/a/div
img src="URL_IMAGEN" /
/article
articlediv class="info"
h5Título/h5
a href="#"Autor/a/div
img src="URL_IMAGEN" /
/article
articlediv class="info"
h5Título/h5
a href="#"Autor/a/div
img src="URL_IMAGEN" /
/article
articlediv class="info"
h5Título/h5
a href="#"Autor/a/div
img src="URL_IMAGEN" /
/article
/div
/div
/div
div id="controls"
label for="slide1"/labellabel for="slide2"/labellabel for="slide3"/labellabel for="slide4"/labellabel for="slide5"/label/div
div id="active"
label for="slide1"/labellabel for="slide2"/labellabel for="slide3"/labellabel for="slide4"/labellabel for="slide5"/label/div
/div
Donate cars Illinois Online casino state of california car insurance HOME PHONE INTERNET BUNDLE Online Colleges Car Donate mesothelioma law firms Dwi lawyer Custom WordPress theme designer Criminal lawyer ANNUITY SETTLEMENT Register Free Domains mesothelioma litigation Psychic for Free DONATE YOUR CAR SACRAMENTO WORLD TRADE CENTER FOOTAGE Structures Annuity Settlement Best social media platforms for business buyer of structured settlement annuity Hire php developers DALLAS MESOTHELIOMA ATTORNEYS PHD IN COUNSELING EDUCATION best accident attorneys Custom Christmas cards Casino Social media management DUI lawyer houston mesothelioma attorney business administration masters structured settlement investments cloud identity and access management Social media platforms for business Mobile casino Casino reviews How to donate a car in California Social media tools Sell Annuity Payment motorcycle accident lawyer san francisco motor insurance quotes Learning adobe illustrator WordPress themes for designers CHEAP AUTO INSURANCE IN VA Service business software adverse remortgage Dallas Mesothelioma Attorneys Make money online Australia mesothelioma lawsuit Php programmers for hire Business finance group Online Stock Trading bowne virtual data room Live casino CHEAP CAR INSURANCE FOR LADIES Online Christmas cards mesothelioma lawyer asbestos cancer lawsuit domain registration yahoo DONATE OLD CARS TO CHARITY Hire php programmers HOW TO DONATE A CAR IN CALIFORNIA Photo Christmas cards HARDDRIVE DATA RECOVERY SERVICES injury lawyers west palm beach Business VOIP Solutions benchmark lending Psd to WordPress Automobile Accident Attorney Computer science classes online Met Auto Dayton Freight Lines caraccidentlawyer World Trade Center Footage ASBESTOS LAWYERS mesotheloma Criminal defense lawyer CAR INSURANCE QUOTES UTAH Car Insurance Quotes Utah ROYALTY FREE IMAGES STOCK structured settlements annuities AUTOMOBILE ACCIDENT ATTORNEY mesothelioma suit Bankruptcy lawyer Hire php developer structured settlements companies donate your car for kids Motor Insurance Quotes Social media campaigns mesothelioma lawyers san diego structered settlement Donate Your Car Sacramento Cheap Car Insurance for Ladies Mesothelioma Law Firm tucson car accident attorney Car Insurance Companies Holland Michigan College Best Seo company Php programmers Seo companies buying an annuity calculator New social media platforms Donate your Car for Money cheap auto insurance in va car crash attorneys PHD on Counseling Education personal injury attorney ocala fl selling annuity payments for cash seattle mesothelioma lawyer Auto Accident Attorney Seo services life insurance co lincoln Mortgage adviser Motor replacements selling annuity car insurance quotes Car insurance in South Dakota mesothelioma compensation Business management software Best social media platforms Seo company Social media examiner low credit line credit cards Massage school Dallas Texas att call conference Annuity Settlements structured annuity settlement maritime lawyer houston paperport promotional code onlineclasses Motor Replacements california law lemon WordPress hosting ashely madis Donate Cars in MA Criminal defense attorneys Florida FUTURISTIC ARCHITECTURE Donate Old Cars to Charity mesothelioma survival rates See more at http//wwwginfostopnet/ Tech school Html email Social media platforms Christmas cards Proud Italian cook Forensics Online Course Psd to html Italian cooking school WordPress theme designers Futuristic Architecture car accident lawyers west palm beach la personal injury lawyer Adobe illustrator classes Car Insurance Quotes Colorado Social media strategies cheap car insurance in virginia Better Conference Calls mesothelioma attorney florida injury lawyers Data Recovery Raid personal injury law firm BETTER CONFERENCING CALLS Donate Car to Charity California Donate Car for Tax Credit buying structured settlements lawyers accidents Auto Mobile Shipping Quote Donate Your Car for Kids motorcycle accident lawyer california EMAIL BULK SERVICE DONATING A CAR IN MARYLAND miami personal injury attorney How to Donate A Car in California wisconsin mesothelioma attorney Gas/Electricity miami personal injury lawyer Car Insurance Quotes PA cheap domain registration hosting quotes car donating used cars to charity cell cycle regulation ppt Life insurance co Lincoln Donate Car To Charity CALIFORNIA Asbestos Lawyers structured settlement company donate car for tax credit Best Criminal Lawyers in Arizona small business administration sba Nunavut Culture most profitable internet business DONATE A CAR IN MARYLAND ONLINE MOTOR INSURANCE QUOTES virtual data rooms Hard drive Data Recovery Services Donate a Car in Maryland bus accident attorney los angeles Cheap Domain Registration Hosting Donating a Car in Maryland Donate Cars Illinois buy structured settlements Criminal Defense Attorneys Florida st louis mesothelioma attorney Car insurance quotes Colorado Life Insurance Co Lincoln Online Motor Insurance Quotes injury lawyer houston tx Paperport Promotional Code Royalty Free Images Stock Online Classes saskatchewan auto insurance structured settlement cash out hosted predictive dialers Injury Lawyers