miércoles, 15 de enero de 2014

Filled Under: , ,

Entradas populares tipo 'flyout' en Blogger. Seis estilos. – Donate

Esto delflyout es el término que usa un plugin Wordpress llamado así (Nrelate Flyout) y que muestra en una ventana emergente que aparece en la parte inferior del blog al hacer scroll (elflyout de marras), entradas supuestamente relacionadas con la que se está leyendo en ese momento.

No conocía ese plugin como tal, pero sí que había visto el efecto en algunos sitios y pienso que para algunos casos puede quedar bien y ser práctico... ambas cosas. Se puede montar fácilmente a mano para enlaces fijos y posiblemente también para posts relacionados (esto lo tendría que ver con más tiempo), pero para lo que se puede adaptar de manera muy sencilla espara el gadget de Entradas Populares de Blogger.

Es sólo cuestión de un poco (muy poco) de JavaScript y mucho de estilo (CSS).

Flyout - Estilo Linkwithin

Para verlo, sólo tenéis que bajar en esta entrada y lo veréis aparecer abajo a la derecha. Eso sí, como yo tengo actualmente el gadget baseun poco raro, el formato no será como los que después os presentaré. Cuando terminéis de verlo no olvidéis volver aquí para aprender cómo añadirlo a vuestro sitio.



Paso previo


Añadir gadget Entradas Populares
Clic para ampliar
En primer lugar tenemos que añadir desdeDiseño un gadget del tipoEntradas populares. Le ponermos título, marcamos el periodo de tiempo de dónde extraer los posts más leídos, seleccionamos las dos casillas de verificación que salen para miniatura y resumen de texto y por último, seleccionamos el número de posts a mostrar.

De los estilos que mostraré al final, algunos sólo soportan determinado número, así que si se os ve chungo sólo tenéis que repasar el comentario que añadí a cada estilo.


Añadir jQuery


Empezamos con el código comprobando que tenemos la librería jQuery en la plantilla. Si no es así sólo hay que editarla y añadir esta línea tras la etiqueta de cierre/b:skin. Si tenéis dos, pues tras la segunda.

script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/


Manipulando el gadget original


Lo siguiente y de hecho podría ir justo a continuación de la anterior línea, sería añadir el JavaScript que creará el efecto.

script type='text/javascript'
//![CDATA[
$(document).ready(function() {
$(".PopularPosts").prepend("a class='closeflyout' href='javascript:void(0);' onclick='return closeflyout();'☒/a");
});
$(window).scroll(function(){
if($(document).scrollTop()=$(document).height()/5) {
$(".PopularPosts").show("slow");
} else {$(".PopularPosts").hide("slow");}
});
function closeflyout(){$(".PopularPosts").remove();
;}
//
/script

Este código lo que hace es manejar el selector que lleva por defecto el gadget.PopularPosts aplicándole lo siguiente (en el mismo orden en que va en el código):

  • Añadir dentro del contenedor general una equis (☒) que ejecutará la función de cerrar (eliminar) la caja
  • Comprobar si estamos haciendo scroll
  • Abrir una condición para ver a qué altura sobre el total de la página nos encontramos. Si es más de la quinta parte, se ejecutará una opción y en caso contrario otra
  • En el primer caso la caja se mostrará (.show)
  • Y si es inferior (estamos en el primer quinto de la página), se ocultará (.hide)
  • La última función lo que hace es eliminar del todo la caja (tranquilos, al refrescar se crea de nuevo) y es la que usa la ☒ que añadimos en primera instancia

Aquí se puede cambiar un poco el tema de cómo aparece la caja, pero eso ya queda para los que gusten de hacer virguerías. Lo más fácil es cambiar el divisor (5) por otro mayor o menor, según se quiera que aparezca antes o después y elslow por un valor numérico o porfast para cambiar la velocidad de la transición.


Añadir el estilo (CSS)


¿Eso es todo? No, pero casi. Para que la caja salga mona monísima ya entramos en el terreno del CSS y de todo lo que veréis, lo único imprescindible es que la caja principal tenga un valordisplay: none; para que inicialmente esté oculta. Lo demás se puede cambiar libremente.

El lugar dónde añadir esto... dónde siempre va el CSS, o bien en la plantilla entre las etiquetasskin, o desde elDiseñador de Plantillas Avanzado Añadir CSS o bien dónde recomiendo a los novatos para que si se aburren de este artilugio tengan fácil quitar todo.

Esto último sería justo a continuación del script anterior y en esa parte de la plantilla se logra que funcione añadiendostyle /style y luego insertando justo en medio el CSS.


Las seis versiones


Para que no haya que envidiarle nada a WP, he replicado de la página de capturas denrelate flyout, los seis estilos que he considerado más vistosos o prácticos y que son estos. Elegid uno, añadidlo a vuestro sitio y a disfrutar el gadget.

Flyout - Estilo Linkwithin
Estilo Linkwithin (4 posts)

/* Estilo 1 - Linkwithin - 4 entradas */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;width: 400px;margin:0;padding: 10px;text-align: center;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {display: inline;margin: 0 20px;text-align: center;}
.PopularPosts .widget-content ul {font-size: 0;}
.PopularPosts .widget-content ul li {display: inline-block;*display: inline; zoom: 1;width: 23%;margin: 3px;padding:0;vertical-align: top;}
.PopularPosts .item-thumbnail {float: none;margin: 0;padding: 3px;border: 1px solid #999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}
.PopularPosts img {width: 100%;height: auto; }
.PopularPosts .item-title a {font-size: 12px;text-transform: uppercase;}
.PopularPosts .item-snippet {display: none;}


Flyout - Estilo Huffington
Estilo Huffington (1 post)

/* Estilo 2 - Huffington - 1 entrada */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;width: 400px;margin:0;padding: 10px;text-align: center;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {display: inline;margin: 0 20px;text-align: center;}
.PopularPosts .widget-content ul {font-size: 0;}
.PopularPosts .widget-content ul li {margin: 3px; padding: 0;text-align: left;vertical-align: top;}
.PopularPosts .item-thumbnail {float: left; margin: 0 10px 0 0;padding: 3px; border: 1px solid #999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}
.PopularPosts img {width: 100%;height: auto;}
.PopularPosts .item-title a {line-height: 22px;text-transform: uppercase;}
.PopularPosts .item-title a, .PopularPosts .item-snippet {font-size: 12px;}


Flyout - Estilo Trendland
Estilo Trendland (3 posts)

/* Estilo 3 - Trendland - 3 entradas */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;width: 400px;margin:0;padding: 10px;text-align: center;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {display: inline;margin: 0 20px;text-align: center;}
.PopularPosts .widget-content ul {font-size: 0;}
.PopularPosts .widget-content ul li {position: relative;display: inline-block;*display: inline;zoom: 1;width: 30%;margin: 3px;padding: 0;vertical-align: top;}
.PopularPosts .item-thumbnail {float: none;margin: 0;padding: 3px;border: 1px solid #999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}
.PopularPosts img {width: 100%;height: auto;}
.PopularPosts .item-title a {position: absolute;top: 66%;left: 0;width: 100%;height: 28px;overflow: hidden;line-height: 14px;font-size: 12px;color: #333;background: #eee;border-top: 1px dotted #999;border-bottom: 1px dotted #999;}
.PopularPosts .item-snippet {display: none;}


Flyout - Estilo Huffington Posts
Estilo Huffington Posts (cualquier número)

/* Estilo 4 - Huffington Posts - x entradas */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;width: 400px;margin:0;padding: 10px;text-align: center;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {display: inline;margin: 0 20px;text-align: center;}
.PopularPosts .widget-content ul {font-size: 0;}
.PopularPosts .widget-content ul li {padding: 4px 0;text-align: left;vertical-align: top;border-bottom: 1px solid #999;}
.PopularPosts .widget-content ul li:last-child {border-bottom: 0;}
.PopularPosts .item-thumbnail {float: left; margin: 0 10px 0 0; border: 1px solid #999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}
.PopularPosts img {width: 100%;height: auto;}
.PopularPosts .item-title a {line-height: 22px;text-transform: uppercase;}
.PopularPosts .item-title a, .PopularPosts .item-snippet {font-size: 12px;}


Flyout - Estilo Polaroid
Estilo Polaroid (3 posts)

/* Estilo 5 - Polaroid - 3 entradas */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;width: 400px;margin:0;padding: 10px;text-align: center;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {display: inline;margin: 0 20px;text-align: center;}
.PopularPosts .widget-content ul {font-size: 0;}
.PopularPosts .widget-content ul li {display: inline-block;*display: inline; zoom: 1;width: 25%;height: 150px;overflow:hidden;margin: 16px 5px 8px;padding: 3px;background: #fff;border: 1px solid #999;border-radius:4px;vertical-align: top;box-shadow: 1px 1px 4px #999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}
.PopularPosts .widget-content ul li:nth-of-type(1) {-moz-transform: rotate(-3deg);-webkit-transform: rotate(-3deg);transform: rotate(-3deg);}
.PopularPosts .widget-content ul li:nth-of-type(2) {-moz-transform: rotate(2deg);-webkit-transform: rotate(2deg);transform: rotate(2deg);}
.PopularPosts .widget-content ul li:nth-of-type(3) {-moz-transform: rotate(4deg);-webkit-transform: rotate(4deg);transform: rotate(4deg);}
.PopularPosts .item-thumbnail {float: none;margin: 0;}
.PopularPosts img {width: 100%;height: auto; }
.PopularPosts .item-title a {font-size: 12px;text-transform: uppercase;}
.PopularPosts .item-snippet {display: none;}


Flyout - Estilo Texto
Estilo texto (cualquier número)

/* Estilo 6 - Text - x entradas */
a.closeflyout {float: right;margin: 0;padding: 0;font-size: 14px;line-height: 14px;color:#333;}
a.closeflyout:hover {text-decoration: none; color: red;}
.PopularPosts {display:none;}
.PopularPosts {position: fixed;bottom:0;right:0;margin:0;padding: 10px;text-align: left;background: #eee;border:1px solid #999;border-radius: 10px 0 0 10px;z-index: 999;}
.PopularPosts h2 {margin: 0 20px 8px 0;text-transform: uppercase;}
.PopularPosts .widget-content ul {list-style: circle;}
.PopularPosts .widget-content ul li {padding:0;}
.PopularPosts .item-thumbnail, .PopularPosts .item-snippet {display:none;}
.PopularPosts .item-title a {font-size: 12px;line-height: 14px;}


Agradecimientos


A Paulino, administrador dewww.instalacionesyeficienciaenergetica.com, que me dió a conocer el plugin de WP, me encargó su construcción y tuvo a bien permitirme publicarlo libremente para general conocimiento.

MESOTHELIOMA LAW FIRMDONATE CAR TO CHARITY CALIFORNIAHARDDRIVE DATA RECOVERY SERVICESDONATE A CAR IN MARYLAND DONATING A CAR IN MARYLAND,DONATE CARS ILLINOIS,CRIMINAL DEFENSE ATTORNEYS FLORIDA ,BEST CRIMINAL LAWYER IN ARIZONASTRUCTURED ANNUITY SETTLEMENT,ASBESTOS LAWYERS,NUNAVUT CULTURE,DAYTON FREIGHT LINES ,Bextra Bankruptcy Dental Plan Private JetMundial FootballFIFA World Cup Vestidos de Perros y gatosHosting Dominio web movilSelling annuity payments for cashSelling annuity payments for cash,Sell my structured settlement,Sell structured settlement,Structured settlementStructured settlement companies,Sell my annuity payments lump sum,Car accident lawyer Denver,Accident injury attorneys,Sell my annuity

MESOTHELIOMA LAW FIRMDONATE CAR TO CHARITY CALIFORNIAHARDDRIVE DATA RECOVERY SERVICESDONATE A CAR IN MARYLAND DONATING A CAR IN MARYLAND,DONATE CARS ILLINOIS,CRIMINAL DEFENSE ATTORNEYS FLORIDA ,BEST CRIMINAL LAWYER IN ARIZONASTRUCTURED ANNUITY SETTLEMENT,ASBESTOS LAWYERS,NUNAVUT CULTURE,DAYTON FREIGHT LINES ,Bextra Bankruptcy Dental Plan Private JetAsi que mejor me fue a un hotel y motel FIFA World Cup Mundial Football New Orleans mesothelioma lawyer y mas que todo que la pase bien en ese hostal y me me fui de viaje a tennessee mesothelioma attorney donde EEUU me pidio la visa pero mejor aun many people in mesothelioma trial lawyers pero me fui a travel Alaska nebraska mesothelioma attorney pero mas aun con mesothelioma attorney nebraska mas siempre fue asi des hace mucho time merlin olsen lawsuit,Selling annuity payments for cash,Sell my structured settlement,Sell structured settlement,Structured settlement,Structured settlement companies,Sell my annuity payments lump sum,Car accident lawyer Denver,Accident injury attorneys,Sell my annuity

Donate Car To Charity CALIFORNIA DONATE CAR FOR TAX CREDITDONATE CARS IN MADONATE YOUR CAR SACRAMENTOHOW TO DONATE A CAR IN CALIFORNIA DONATE YOUR CAR FOR KIDS,CAR INSURANCE QUOTES COLORADO ,NUNAVUT CULTURE,DAYTON FREIGHT LINESHARDDRIVE DATA RECOVERY SERVICES,DONATE A CAR IN MARYLAND,MOTOR REPLACEMENTS,CHEAP DOMAIN REGISTRATION HOSTING,DONATING A CAR IN MARYLAND

Donate a car in Maryland Webex Costs Psd to WordPress buy gift card structured settlement cash out Casino reviews Custom WordPress theme designer New social media platforms Best social media platforms accident attorney orange county onlineclasses Php programmers california law lemon Computer science classes online Auto Accident Attorney Life Insurance Co Lincoln Online casino Social media examiner Dayton Freight Lines auto accident attorney Mobile casino Make money online Australia structured settlements annuities Donate Cars in MA Personal Injury Law Firm auto insurance cost by state Casino Register free domains structured settlement agreement Best Criminal Lawyers in Arizona Mesothelioma Law Firm Hire php programmers Car Donate WordPress hosting Live casino business voip solutions Online Classes Online Christmas cards Criminal defense attorneys Florida Service business software mesothelioma charities CHEAP AUTO INSURANCE IN VA Automobile Accident Attorney DONATE YOUR CAR SACRAMENTO mesothelioma attorney california HOLLAND MICHIGAN COLLEGE Php programmers for hire Social media tools Best Seo company DUI lawyer How to Donate A Car in California annuity payment harddrive data recovery services motorcycle lawyer los angeles hughes net business Criminal lawyer Hire php developers motor insurance quotes Car Insurance Companies primary pulmonary hypertension Bankruptcy lawyer Donating Used Cars to Charity Structures Annuity Settlement Annuity Settlements Dwi lawyer Photo Christmas cards better conferencing calls workers compensation lawyer los angeles accident attorney san bernardino Motor Replacements DAYTON FREIGHT LINES best criminal lawyer in arizona Criminal defense lawyer Sell Annuity Payment Social media platforms for business mesothelioma drug Hire php developer life insurance quotes Cheap car insurance for ladies Html email donating used cars to charity mesothelioma lawyer houston adverse remortgage Asbestos Lung Cancer WordPress themes for designers Health Records Personal Health Record Seo companies CAR INSURANCE QUOTES COLORADO ONLINE COLLEDGES Email bulk service Insurance Companies Better Conference Calls Proud Italian cook mesothelioma lawyer virginia buyers of structured settlements Car Accident Lawyers online motor insurance quotes Car Insurance Quotes Colorado Best social media platforms for business truck accident attorney los angeles Donate a Car in Maryland donate your car for money cash out annuity Cheap auto insurance in VA Business finance group personal injury law firm Social media strategies structured settlement brokers hair removal washington dc Seo services How to donate a car in California houston tx auto insurance cell cycle regulation ppt Forex Trading Platform Home Phone Internet Bundle AUTO ACCIDENT ATTORNEY canada personals yahoo mesothelioma law firms MET AUTO Business management software boca raton personal injury attorney Attorney how to donate a car in california tennessee mesothelioma lawyer Seo company Hard drive Data Recovery Services See more at http//wwwginfostopnet/ Custom Christmas cards PSYCHIC FOR FREE Online Criminal Justice Degree Christmas cards low credit line credit cards offshore accident lawyer auto accident lawyer san francisco Asbestos Lawyers forensics online course philadelphia mesothelioma lawyer Italian cooking school ASBESTOS LAWYERS PAPERPORT PROMOTIONAL CODE chicago hair laser removal Criminal Defense Attorneys Florida car insurance quotes pa CAR INSURANCE QUOTES UTAH refinance with bad credit Social media management car insurance companies Tech school Social media platforms Social media campaigns Psd to html Cheap domain registration hosting LOW CREDIT LINE CREDIT CARDS mesothelioma settlement amounts sell your structured settlement payments Online Motor Insurance Quotes Met Auto car accident lawyer san bernardino benchmark lending WordPress theme designers structured annuity settlement Adobe illustrator classes Motor Insurance Quotes Learning adobe illustrator mesothelioma compensation virtual data rooms Donate Old Cars to Charity mesothelioma suit Cheap Car Insurance in Virginia broward county dui lawyer MESOTHELIOMA LAW FIRM Gas/Electricity Donate Car to Charity California structured settlemen Donate Car for Tax Credit Donate Your Car Sacramento Dallas Mesothelioma Attorneys Auto Mobile Shipping Quote car accident lawyer in san diego MORTGAGE ADVISER injury lawyers west palm beach ONLINECLASSES Donate Your Car for Kids Auto Mobile Insurance Quote structured settlement buyers mesothelioma lawyers san diego personal accident attorney Online College Course EMAIL BULK SERVICE Nunavut Culture Car insurance quotes Utah uk homeowner loans cloud identity and access management NUNAVUT CULTURE domain yahoo CHEAP CAR INSURANCE IN VIRGINIA Online Colleges colorado mesothelioma lawyers Cheap Auto Insurance in VA PHD on Counseling Education Cheap Domain Registration Hosting Donating a Car in Maryland Donate Cars Illinois Data Recovery Raid MOTOR REPLACEMENTS PhD in counseling education Car Insurance Quotes Utah Holland Michigan College Claim CAR INSURANCE QUOTES MN