let header = document.getElementById(«okd-cabecera»);
headerBottom = header.getBoundingClientRect().bottom;
headerTop = header.getBoundingClientRect().top;
let containerMarginTop = top1Container.getAttribute(«marginTop»);
let marginForTop = 2;
//Si el top y el bottom del bounding client rect del top1 son iguales quiere decir que no se ha cargado el anuncio.
//Entonces no lo movemos.
if( top1Bottom > top1Top){
//console.log(«DGSTICKY header: » + headerTop + » » + headerBottom + » » + header.offsetHeight);
//console.log(«DGSTICKY top: » + top1Top + » » + top1Bottom + » » + top1.offsetHeight);
//console.log(«DGSTICKY topContainer: » + top1ContainerTop + » » + top1ContainerBottom + » » + top1Container.offsetHeight);
//console.log(«DGSTICKY scroll » + window.scrollY + » » + window.scrollX);
top1Position = 0 ;
//Si el header colapsado, 168 -128 px (top negativo) = 40px
if(headerBottom marginForTop){
top1Position += marginForTop
};
//Si el contendor está fuera del viewport
if(top1ContainerTop top1Container.offsetHeight){
top1Position -= ( top1Position + top1.offsetHeight ) – top1Container.offsetHeight ;
}
//console.log(«DGSTICKY top1Position «+top1Position);
}
top1.style.position = ‘absolute’;
top1.style.top = top1Position+’px’;
top1.style.left = «50%»;
top1.style.transform=»translate(-50%, 0)»;
}
});
}
}
function adParentClass() {
let hereAds = »;
intexts = «»;
if (bodyContains(‘paged’)) {
intexts = »;
}
if (bodyContains(‘home’)) {
hereAds += «#top1, #right1, #right2, #right3, #right4, #right5, #right6, #mpu-video1, #bottom»;
} else if (inPortadilla()) {
hereAds += «#top1, #right1, #right2, #right3, #right4, #right5, #right6, #bottom, #x01»;
} else if (bodyContains(‘archive’)) {
//Se elimina #intext1 e #intext2 para que no se añada el placeholder dado que impide hacer click en los enlaces
hereAds += «#top1, #right1, #right2, #bottom, #x01» + intexts;
} else if (bodyContains(‘single’)) {
//Se elimina #intext1 e #intext2 para que no se añada el placeholder dado que impide hacer click en el link de comentarios
hereAds += «#top1, #right1, #right2, #right3, #bottom, #x01, #podcast_passback1» + intexts;
// Ajuste para tag-no-publi
let singlePostContent = document.querySelector(«#postContent>article»);
if (singlePostContent.classList.contains(«tag-no-publi»)) return true;
}
José Luis Perales ha sido, inesperadamente, uno de los grandes protagonistas de la noche de este lunes 7 de agosto. Y siendo honestos, no es para menos. En cuestión de minutos, varios medios de comunicación latinoamericanos decidieron dar la voz de alarma, asegurando que el cantautor español había muerto.
Y no solamente eso, sino que habían asegurado que había fallecido como consecuencia de un infarto de miocardio. Una información que quedó desmentida, en un primer momento, a través de su hijo Pablo Perales, quien confirmó que su padre estaba bien y que se encontraban de vacaciones, en familia, en Londres.
Lejos de que todo quede ahí, el propio José Luis Perales quiso grabar un vídeo que no ha tardado en hacerse viral en redes sociales, de la misma manera que se hizo viral su supuesta muerte. De esta forma, el cantautor decía lo siguiente: “Hola, amigos, os hablo desde Londres. Un sitio maravilloso, un lugar precioso, donde he pasado unos días con mis hijos y con mi mujer, y ahora estamos a punto de marcharnos”.
Por si fuera poco, el intérprete de Un velero llamado libertad fue más allá: “De repente nos encontramos con que alguien, de muy mala idea, ha dicho que me he muerto. Y la verdad es que estoy más vivo que nunca, más feliz que nunca”. Además, añadió: “Y mañana ya nos estaremos viendo en España. Gracias a todos los que habéis intentado saber que era verdad esta cosa. ¡Que estamos muy bien! ¡Se acabó! Hasta mañana”.
Sin duda, una situación de lo más peculiar que ya ha marcado un antes y un después en la historia. Una vez más, queda demostrada la fuerza de las redes sociales en cuanto a viralidad pero, a su vez, queda claro que no todo lo que se publica es cierto. Hay que esperar a conocer la realidad. Y no hay más realidad que nuestro José Luis Perales está “más vivo que nunca”. ¡Y no podemos estar más felices!
Más artículos relacionados con HappyFM
Lo último en HappyFM
Últimas noticias
n’ +
‘
Cerrar sesión
n’ +
‘
n’ +
»);
let isIExplore = (/MSIE (d+.d+);/.test(navigator.userAgent) || !!navigator.userAgent.match(/Trident.*rv:11./) || navigator.userAgent.indexOf(‘Edge’) !== -1);
if (isIExplore) {
$(‘.nav-socios-menu’).css(‘margin-top’, ‘0px’);
}
function validateEmail(email) {
const re = /^(([^()[]\.,;:s@»]+(.[^()[]\.,;:s@»]+)*)|(«.+»))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
function validatePassword(password, repeatPassword){
if (password === repeatPassword && password.length >= 8){
return true;
}else{
return false;
}
}
function goToLoginModal(){
var cookieSocios = (document.cookie.match(/^(?:.*;)?s*f2da8790d54184f6c100d431d8e45430s*=s*([^;]+)(?:.*)?$/)||[,null])[1];
if(cookieSocios === null || cookieSocios === »){
window.location.href = ‘#loginModal’;
}
}
function showSociosButtons(){
fixIosSocios();
$(‘.socios-okclub’).removeClass(‘hidden’);
}
function fixIosSocios() {
let isIos = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (isIos && screen.width 767){
//Modificamos imagen de publicidad del MPUVideo1 si existe
if($(‘#mpu-video1’).length){
var imgSociosMpuVideo1 = document.createElement(«IMG»);
imgSociosMpuVideo1.setAttribute(«src», «/web/themes/v10/socios/_img/socios_300X250.jpg»);
document.querySelector(«#mpu-video1»).appendChild(imgSociosMpuVideo1);
}
//Obtenemos los items de publicidad.
var divsPublicidad = document.querySelectorAll(‘.publicidad’);
divsPublicidad.forEach(function(el){
//Crear variables con las imagenes de 300×600 y 300×250.
var imgSocios300x250 = document.createElement(«IMG»);
var imgSocios300x600 = document.createElement(«IMG»);
imgSocios300x250.setAttribute(«src», «/web/themes/v10/socios/_img/socios_300X250.jpg»);
imgSocios300x600.setAttribute(«src», «/web/themes/v10/socios/_img/socios_300x600.jpg»);
imgSocios300x250.setAttribute(«style», «margin: auto; display: flex; justify-content: center; align-items: center;»);
imgSocios300x600.setAttribute(«style», «margin: auto; display: flex; justify-content: center; align-items: center;»);
//Añadimos las imágenes a los huecos publicitarios de la portada.
if(el.className.includes(‘300×250’) != false){
var itemPubli = el.firstElementChild;
itemPubli.innerHTML = »;
itemPubli.appendChild(imgSocios300x250);
}
});
}
}
/*Cargar publi de socios en portada, deportes y economía – END*/
function posicionate () {
var article = sessionStorage.getItem(«article»);
if (article) {
var coord = $(‘article[data-id=»‘+article+’»]’).offset();
if(typeof coord === «undefined») return;
var total = parseInt(coord.top) – parseInt($(‘.mega’).height());
window.scrollTo(0, total);
}
}
function saveArticle (article) {
var dataId = $(article).attr(‘data-id’);
sessionStorage.setItem(«article», dataId);
}
function goLink(link) {
return false;
}
// Navegacion de los blogs
function navigateBlogs(category) {
$(‘.category-ul’).addClass(‘category-hidden’);
$(‘#images-‘+category).removeClass(‘category-hidden’);
}
//Animación de todos los valores
function tickerAnimationEconomicAll() {
var tickerContainer = $(‘.prices-data-container.economic-all’)
var tickerList = $(‘.economic-all .prices-data-list’);
var tickerItem = $(‘.economic-all .price-data-wrapper’);
//Si el primer elemento del carrusel, está fuera de la vista
if ((tickerItem.eq(0).offset().left + tickerItem.eq(0).width())
‘);
percentageChange.eq(i).addClass(«percentage-change-red»);
percentageChange.eq(i).removeClass(«percentage-change-green»);
}
//Positivo
else if (res.tickers[j].pcp.substring(0, 1) == ‘+’) {
changeDirection.eq(i).html(‘‘);
percentageChange.eq(i).addClass(«percentage-change-green»);
percentageChange.eq(i).removeClass(«percentage-change-red»);
}
}
}
}
function hideFeaturedMenu(){
$(‘.okdiario-destacados-dropdown-container’).slideUp(«normal»);
$(«.okdiario-destacados-dropdown-container»).removeClass(«activa»);
$(«.okdiario-destacados-dropdown-top-title»).removeClass(«activa»);
//$(document).click(function (){});
}
function showFeaturedMenu(){
$(‘.okdiario-destacados-dropdown-container’).slideDown(«normal»);
$(«.okdiario-destacados-dropdown-container»).addClass(«activa»);
//Mover el icono
$(«.okdiario-destacados-dropdown-top-title»).addClass(«activa»);
//al pulsar fuera del menú, ocultarlo
$(document).on(«click touchend touch», function (event) {
// Si se ha pulsado en el boton de desplegar/ocultar el menu, entonces no se oculta
// ya que se encargara el evento de la funcion featuredMenu().
if (!$(event.target).closest(«.okdiario-destacados-dropdown-top-title»).length &&
$(‘.okdiario-destacados-dropdown-container’).hasClass(«activa»)) {
hideFeaturedMenu();
}
});
}
/*Menú de destacados, mostrar más elementos al hacer clic*/
function featuredMenu(){
$(«.okdiario-destacados-dropdown-top-title»).click(function(event){
event.stopPropagation();
// Si esta escondido el menu.
if(!$(‘.okdiario-destacados-dropdown-container’).hasClass(«activa»)){
// Mostrar
showFeaturedMenu()
} else{
hideFeaturedMenu()
}
});
//Añado el evento onclik para todo el LI
$(«.okdiario-destacados-dropdown > li»).on(«click», function (){
window.location = $(this).find(«a»).first().attr(«href»);
return false;
});
//Elementos del menú destacados
var options = $(«.okdiario-destacados-container li»).get().reverse();
if(options.length > 0){
$(options).each(
function (index, element){
//Si están ocultos (overflow)…
if (index ul > li:has(ul)’).addClass(‘desplegable’);
$(‘.okd-cabecera-inferior-izquierda-nav-menu-auxiliar > ul > li > ul > li:has(ul)’).addClass(‘desplegable-sub’);
$(‘.okd-cabecera-inferior-izquierda-nav-menu-auxiliar > ul > li.desplegable > a,.okd-cabecera-inferior-izquierda-nav-menu-auxiliar > ul > li.desplegable > span’).after(‘‘);
$(‘.desplegable-sub > a’).after(‘‘);
function searchButton(){
/*EN LA CABECERA, TODAS LAS PAGINAS*/
$(«.okd-cabecera-inferior-izquierda-search-icon»).click(function(){
$(«.okd-cabecera-inferior-izquierda-nav-search»).toggleClass(«active»);
//$(«.okd-cabecera-inferior-izquierda-search-form»).toggleClass(«active»);
if ($(«.okd-cabecera-inferior-izquierda-nav-menu»).hasClass(«active»)){
$(«.all»).removeClass(«active»);
$(«.okd-cabecera-inferior-izquierda-nav-menu»).toggleClass(«active»);
$(«.okd-cabecera-inferior-izquierda-nav-menu»).removeClass(«active2»);
$(‘.burger-box’).removeClass(‘open’);
}
});
}
/**
* itera las porpiedades css de offsetArray para obtener los estilos computados como enteros.
* @param {array} offsetArray
* @param {HTMLObjectElement} element
* @returns Int newOffset
*/
function loopOffsets(offsetArray, element) {
// declaramos variable delimitada
let newOffset = 0;
// computed style element
let cse = window.getComputedStyle(element);
// iteramos el array con propiedades css que se pasa como parámetro
offsetArray.forEach((item, index) => {
// comprobamos que haya estilo computado
if («» != cse.getPropertyValue(item) && «undefined» != cse.getPropertyValue(item)) {
// sacamos el entero y lo sumamos
newOffset += parseInt(cse.getPropertyValue(item));
}
// comprobamos que haya estilo en el nodo, por si se le ha asignado dirante la carga
if(«» != element.style.getPropertyValue(item) && «undefined» != element.style.getPropertyValue(item)){
// sacamos el entero y lo sumamos
newOffset += parseInt(element.style.getPropertyValue(item));
}
});
return newOffset;
}
/**
* Itera los hijos del header y obtiene sus alturas, bordes y márgenes para sacar mas limpiamente el sticky-top
* @param {HTMLObjectElement} element
* @param {Integer} offset
* @returns {Integer} offset
*/
function getOffsets(element, offset) {
// declaramos un array con las propiedades
// de las que queremos obtener valor entero
let offsetArray = [
«borderTop»,
«borderBottom»,
«marginTop»,
«marginBottom»,
];
// computed style header
let csh = window.getComputedStyle(element);
// Primero sumamos la altura y los offsets del header
offset += parseInt(csh.height);
offset += loopOffsets(offsetArray, element);
// iteramos con for porque es una colección
for (let ele of element.children) {
// sacamos offsets a cada elemento y
offset += loopOffsets(offsetArray, ele);
// loopeamos sticky-container para sacar la altura de cabecera-superior
// que es el que se tiene que dejar ver
// nos metemos en sticky-container para manejar las excepciones de desktop y mobile
if (ele.classList.contains(«okd-cabecera-sticky-container»)) {
for (let e of ele.children){
// le añadimos sus offsets
offset += loopOffsets(offsetArray, e);
// Comprobamos que estamos en cabecera-superior
// para poder dejar a la vista esa franja
if (e.classList.contains(‘okd-cabecera-superior’)) {
let cssc = window.getComputedStyle(e);
// le quitamos la altura de cabecera-superior
offset -= parseInt(cssc.height) + loopOffsets(offsetArray, e);
} else if (window.innerWidth { logoLink.classList.add(item); });
function logoScrolled(superiorCentroInner, logoLink){
superiorCentroInner.innerHTML = »;
superiorCentroInner.appendChild(logoLink);
}
function logoTop(superiorCentroInner){
superiorCentroInner.innerHTML = ‘El sitio de los inconformistas’;
if (document.body.classList.contains(‘baleares’)) {
superiorCentroInner.innerHTML = ‘Las noticias que los demás no le contarán’;
}
}
function tickLogoColor(bodyClassList){
var tickFile = ‘tick-okd.svg’;
let clases = {
‘con_tick’ :[
‘economia’,
‘deportes’,
‘investigacion’,
‘opinion’,
‘look’,
‘trailer’,
‘sociedad’,
‘category-video’,
‘eurocopa’,
‘andalucia’,
‘okclub’,
‘juegos-olimpicos’,
‘igualdad-deporte’,
‘recetas’,
‘mundial’,
‘loteria-navidad’
],
‘sin_tick’ :[
‘category-corazon’,
‘category-fichajes’,
‘category-tv’,
‘tv’,
‘happyfm’,
‘salud’,
‘okclub’,
‘okgreen’
]
};
try {
for(classArray in clases) {
if (‘con_tick’ === classArray) {
let conTick = clases[classArray];
for(clase in conTick){
if(bodyClassList.contains(conTick[clase])){
// igualdad-deporte tiene que llevar el mismo logo y cabecera que deportes,
// así que le cambiamos la clase para el tick y prau
if («igualdad-deporte» == conTick[clase]) {
conTick[clase] = «deportes»;
}
tickFile = ‘tick-okd-‘+conTick[clase] + ‘.svg’;
if(«category-video» == conTick[clase] && (bodyClassList.contains(«archive») || bodyClassList.contains(«single»))){
tickFile = ‘tick-okd-video.svg’;
}
}
}
} else if (‘sin_tick’ === classArray){
let sinTick = clases[classArray];
for(clase in sinTick){
if(bodyClassList.contains(sinTick[clase])){
tickFile = »;
}
}
}
}
} catch (error) {
console.error(‘Error cargando el logo scrolled ‘, error);
}
return tickFile;
}
// Sticky buttons
function stickyButtons(){
var superiorDerecha = document.querySelector(‘.okd-cabecera-superior-derecha’);
var sociosOkClub = document.querySelector(‘.socios-okclub’);
var fecha = document.querySelector(‘.okd-cabecera-superior-derecha-fecha’);
var actualizacion = document.querySelector(‘.okd-cabecera-superior-derecha-actualizacion’);
var fechaClone = fecha.cloneNode(true);
var actualizacionClone = actualizacion.cloneNode(true);
var socios = document.querySelector(‘.alta’);
var donacion = document.querySelector(‘.apoyanos’);
if(null != socios && null != donacion){
var sociosClone = socios.cloneNode(true);
var donacionClone = donacion.cloneNode(true);
let nightMode = document.getElementById(‘night-mode’);
//Compruebo que no está en el bottom, para no hacer sticky
screenState.isInBottom = (screenState.adBottom.exists && screenState.right.bottom >= screenState.adBottom.top – 40) ||
(!screenState.adBottom.exists && screenState.right.bottom >= screenState.footerPage.top -40);
//Si no hay espacio suficiente no se hace sticky
if (screenState.adBlockHeight 500 && screenState.bottomElementTop – screenState.prevElementBottom > 750)) {
// Si la cabecera llega a la posición del banner que se va a hacer sticky
if (screenState.cabecera.bottom >= screenState.right.top && screenState.cabecera.top = screenState.adBottom.top – 20) {
screenState.status = ‘AD_BOTTOM_ABSOLUTE’;
$(«.ad-block:eq(«+ad_block_index+»)»).css(«position», «absolute»);
$(«.ad-block:eq(«+ad_block_index+»)»).css(«top», screenState.right.top-(screenState.right.bottom-screenState.adBottom.top+40));
}
} else {
if (screenState.right.bottom >= screenState.footerPage.top -20) {
screenState.status = ‘PAGE_BOTTOM_ABSOLUTE’;
$(«.ad-block:eq(«+ad_block_index+»)»).css(«position», «absolute»);
$(«.ad-block:eq(«+ad_block_index+»)»).css(«top», screenState.right.top – (screenState.right.bottom – screenState.footerPage.top + 40));
}
}
// Si la cabecera deja de estar sobre el right sticky se hace sticky
if (screenState.cabecera.bottom .branded-lotusbc»).length || $(«#branded-container > .branded-jaguarbc»).length || $(«#branded-container > .branded-festinabc»).length;
let intextActive = false;
if (checkBodyClass(‘paged’)) return true;
intext1 = intextActive ? »:»;
var windowWidth = window.innerWidth;
let hasNotNoIntextTag = !document.body.classList.contains(‘tag-no-intext’);
let maxWidth1023 = window.matchMedia(‘(max-width: 1023px)’);
if( $(‘body’).hasClass(‘single’) && $(‘.content-video’).length no_intexts_bc && intextActive) {
$(‘.entry-content h3:eq(1)’).before($(‘
‘));
}
//Banner publi Right2
if ($(‘.entry-content h3:eq(1)’).length) { //Según cómo maqueten los títulos
$(‘.entry-content h3:eq(1)’).before($(‘#adAfterP2’));
}
if ($(‘.entry-content p>span.title2:eq(1)’).length) { //Según cómo maqueten los títulos
$(‘.entry-content p>span.title2:eq(1)’).parent().before($(‘#adAfterP2’));
}
//Banner publi Intext2
if (1 > no_intexts_bc) {
$(‘.entry-content’).append($(‘
‘));
}
//Banner publi Right3
$(‘.entry-content’).append($(‘#adAfterLastP’));
} else if($(‘.okdiario-directo’).length) { //Si directo
//Banner publi right1 mobile
$(‘.entry-content span.comment-text’).first().after($(‘#adAfterP1’));
//Banner publi Right2
if ($(‘.entry-content span.comment-text’).length > 2) {
//Banner publi right2 mobile
$(‘.entry-content span.comment-text:eq(1)’).after($(‘#adAfterP2’));
//Banner publi right3 mobile
if($(‘.entry-content span.comment-text’).length > 4){
$(‘.entry-content span.comment-text:eq(4)’).after($(‘#adAfterLastP’));
}
} else {
//Banner publi right2 mobile
$(‘.entry-content’).append($(‘#adAfterP2’));
}
} else if ($(‘.gallery-image-container’).length) { //Si tiene galería
//Banner publi intext1 mobile
if (1 > no_intexts_bc && intextActive) {
$(‘.entry-content p’).first().after($(‘
‘));
}
//Banner publi right1 mobile
$(‘.entry-content p’).first().after($(‘#adAfterP1’));
//rigth2 debajo de la primera foto
$(‘.gallery-image-container > figcaption’).first().after($(‘#adAfterP2’));
//rigth3 al final del post antes de taboola
$(‘#galleryRight3Container’).html($(‘#adAfterLastP’));
// if ($(‘.entry-content p’).length > 2 && 1 > no_intexts_bc) { //El resto intext igual que están en el single standar
// //Banner publi intext2 mobile
// $(‘.entry-content p:eq(2)’).after($(‘
‘));
// }
// else {
//Banner publi intext2 mobile
// if (1 > no_intexts_bc) {
// $(‘.entry-content’).append($(‘
‘));
// }
// }
} else { //Si no recetas, ni directo, ni tiene galeria
/*No cargamos intexts en post de endesa*/
//Banner publi intext1 mobile
if (1 > no_intexts_bc && intextActive) {
$(‘.entry-content p’).first().after($(‘
‘));
}
//Banner publi right1 mobile
$(‘.entry-content p’).first().after($(‘#adAfterP1’));
if ($(‘.entry-content p’).length > 2) { //Si tiene mas de 2 parrafos
//Banner publi intext2 mobile
// if (1 > no_intexts_bc) {
// $(‘.entry-content p:eq(2)’).after($(‘
‘));
// }
//Banner publi right2 mobile después del segundo párrafo
$(‘.entry-content p:eq(1)’).after($(‘#adAfterP2’));
//Banner publi right3 mobile
if ($(‘.entry-content p’).length > 3) { //Si tiene mas de 3 parrafos
$(‘.entry-content p’).last().before($(‘#adAfterLastP’));
} else { //Si tiene 3 parrafos o menos
$(‘.entry-content p’).last().after($(‘#adAfterLastP’));
}
}
else { //Si tiene 2 parrafos o menos
//Banner publi intext2 mobile
// if (1 > no_intexts_bc) {
// $(‘.entry-content’).append($(‘
‘));
// }
//Banner publi right2 mobile
$(‘.entry-content’).append($(‘#adAfterP2’));
//Banner publi right3 mobile
$(‘.entry-content p’).last().after($(‘#adAfterLastP’));
}
}
} else { //Para pantallas > 1023
if (1 > no_intexts_bc && intextActive) {
if($(‘body’).hasClass(‘recetas’)) { //Si recetas
$(‘.entry-content p:eq(0)’).after($(‘
‘));
// $(‘.entry-content h3:eq(1)’).before($(‘
‘));
} else { //Si no recetas
if ($(‘.entry-content p’).length > 2) { //Si tiene mas de 2 parrafos
// Banner publi intext1 desktop
$(‘.entry-content p:eq(2)’).after($(‘
‘));
}
if ($(‘.entry-content p’).length > 4) { //Si tiene mas de 4 parrafos
// Banner publi intext2 desktop
// $(‘.entry-content p:eq(4)’).after($(‘
‘));
}
}
}
}
}
//Publicidad para los articulos de tipo DIRECTO versión mobile
if($(‘body’).hasClass(‘post-template-directos’) && windowWidth .comment-text’).first().after($(‘#adAfterP1’));
//Banner publi Right2
$(‘.okdiario-directo > .comment-text:eq(2)’).after($(‘#adAfterP2’));
//Banner publi Right3
if ($(‘.okdiario-directo > .comment-text:eq(5)’).length) {
$(‘.okdiario-directo > .comment-text:eq(5)’).after($(‘#adAfterLastP’));
} else {
$(‘.okdiario-directo > .comment-text’).last().after($(‘#adAfterLastP’));
}
}
}
/* START DIRECTO Y ÚLTIMA HORA
/* Animación tipo slider para los menús */
function startMenuAnimation(name) {
if ($(‘#menu-okd-‘ + name + ‘ li’).length > 1) {
var menuItems = $(‘#menu-okd-‘ + name + ‘ li’);
var currentIndex = 0;
/* Animación automática */
var menuInterval = setInterval(intervalAnimation, 10000);
// Deslizar nuevo elemento desde la derecha
function slideFromRight(menuItems, prevIndex, currentIndex) {
menuItems.eq(prevIndex).animate({
left: ‘-120%’
}, 2000, function() {
menuItems.css(‘left’, ‘120%’);
menuItems.eq(currentIndex).animate({
left: ‘0’
}, 2000);
});
}
//Comportamiento de CatFish
function navigationCatfish(){
var OKD_catfish = document.getElementById(«okd-catfish»);
var OKD_btn_CatFish= document.getElementById(«catfish-btn»);
var scroll = 700;
var code_home = ‘
if ($(‘.home’).length){
var scroll = 4500;
}
//Aplicamos únicamente a dispositivos mobile.
if (screen.width = scroll){
//Eliminamos las clases catfish-start y hide-catfish
OKD_catfish.classList.remove(‘catfish-start’);
OKD_catfish.classList.remove(‘hide-catfish’);
//En caso de que sea secciones
if($(‘#seccion_sticky’).length hace referencia a la «portadilla» okdinero
page-id-1664219 => hace referencia a la «portadilla» okdeportes
page-id-2242606 => hace referencia a la «portadilla» diario-madridista
*/
let in_portada_salud = $(‘body’).hasClass(‘page’) && $(‘body’).hasClass(‘salud’);
if($(‘#archiveContent’).length || $(‘.page-id-796511’).length || $(‘.page-id-1664219’).length || $(‘.page-id-2242606’).length || $(‘body’).hasClass(‘ultimas-noticias’) || ($(‘body’).hasClass(‘page’) && $(‘body’).hasClass(‘baleares’)) || true == in_portada_salud ){
code = code_seccion;
}
//En caso de que sea home
if($(‘#contentHome’).length && $(‘#portada_sticky’).length googletag.cmd.push(function() { googletag.display(«portada_sticky_brand»); });‘+’ipt>’;
var code_seccion = ‘
if ($(‘.home’).length){
var scroll = 4500;
}
//Aplicamos únicamente a dispositivos desktop.
if (screen.width > 1023 && «undefinied» != OKD_catfish_heavy && null !=OKD_catfish_heavy && «undefined» != OKD_catfish_heavy && null != OKD_btn_CatFish_Heavy) {
//Cuando se muestra con scroll superior a 1000
if (window.pageYOffset >= scroll){
//Eliminamos las clases catfish-heavy-start y hide-catfish-heavy
OKD_catfish_heavy.classList.remove(‘catfish-heavy-start’);
OKD_catfish_heavy.classList.remove(‘hide-catfish-heavy’);
//En caso de que sea secciones
if($(‘#seccion_sticky_brand’).length = videoParentOffset – 60 && !videoDM.classList.contains(‘featured-video-closed’)) {
//Añadimos clase
videoDM.classList.add(‘sticky-to-top’);
//Añadimos retardo a la aparición del boton close
if ($(‘#’ + anchorId).hasClass(‘btn-close-printed’)) {
btnclose.classList.add(‘btn-close-shown’);
} else {
let tm = setTimeout(function () {
btnclose.classList.add(‘btn-close-shown’);
$(‘#’ + anchorId).addClass(‘btn-close-printed’);
clearTimeout(tm);
}, 7000);
}
} else {
//Comprobamos que exista y eliminamos la clase
if (videoDM.classList.contains(‘sticky-to-top’)) {
videoDM.classList.remove(‘sticky-to-top’);
}
}
}
}
/* FUNCIONALIDAD STICKY-TO-TOP EN VIDEOS DM VERSIÓN MOBILE – START */
/*LOAD SKY unicamente cuando la pantalla sea mayor de 1280px que es cuando se muestran*/
function loadSkys(){
var code_sky_izquierda = »;
var code_sky_derecha = »;
//Se aplica únicamente a pantallas mayores de 1080 y que sean secciones
if(screen.width > 1280 && $(‘#postContent’).length 767) {
let sky_dcha = document.getElementById(‘sky-derecha’);
let sky_izda = document.getElementById(‘sky-derecha’);
let top1BoundingTop = document.getElementById(‘okd_top1_original’).getBoundingClientRect().top;
// declaramos su posición fixed de entrada, y le damos el mismo top que ok-top-1
sky_izquierda.style.position = ‘fixed’;
sky_derecha.style.position = ‘fixed’;
sky_izquierda.style.top = inital_top + ‘px’;
sky_derecha.style.top = inital_top + ‘px’;
// podemos dejar de escuchar scroll por intersectionObserver
document.addEventListener(‘scroll’, function() {
let header = document.getElementById(«okd-cabecera»);
headerBottom = header.getBoundingClientRect().bottom;
/* CountDown de Javier Cárdenas – BORRAR CUANDO YA NO HAGA FALTA PLZ */
if($(«#cardenas-cuenta-atras»).length){
var diasDiv = document.getElementById(‘dias’);
var horasDiv = document.getElementById(‘horas’);
var minutosDiv = document.getElementById(‘minutos’);
var fechaCardenas = new Date(«Sep 6, 2021 06:59:59»).getTime();
var cardenasCounter = setInterval(function(){
var ahora = new Date().getTime();
var cuantoQueda = fechaCardenas – ahora;
var dias = Math.floor(cuantoQueda / (1000 * 60 * 60 * 24));
var horas = Math.floor((cuantoQueda % (1000 * 60 * 60 * 24))/(1000 * 60 * 60));
var minutos = Math.floor((cuantoQueda % (1000 * 60 * 60))/ (1000 * 60));
var segundos = Math.floor((cuantoQueda % (1000 * 60)) / 1000);