- Home
- Categorie
- Coding e Sistemistica
- CMS & Piattaforme Self-Hosted
- Gli articoli non scorrono
-
Gli articoli non scorrono
Buon pomeriggio a tutti, sono nuovo! Avrei una domanda da farvi riguardo un tema wordpress che ho installato. In questo tema c'è la sezione News dove vanno gli articoli recenti. Una volta raggiunti 4 articoli si dovrebbe poter schiacciare la freccetta laterale per far scorrere gli altri articoli (una specie di slide). Tuttavia quando schiaccio questa freccetta, gli articoli non scorrono e il tema scorre leggermente più in basso. Sapete darmi qualche aiuto? Grazie mille anticipatamente
-
Url?
-
-
Il motivo e' che l'evento click delle freccette non viene triggerato, perche' quando clicchi su una freccetta l'href ti porta all'inizio del div #carousel-homepage-latestnews, che e' il contenitore delle news. Invece dovrebbe gestire il click con JavaScript e ignorare l'href delle freccette.
L'unico riferimento alle news che vedo nel JavaScript e' questo:function zerif_home_latest_news(){ if( jQuery( '#carousel-homepage-latestnews').length > 0 ) { jQuery( '#carousel-homepage-latestnews div.item' ).height('auto'); if( isMobile.any() || (!isMobile.any() && jQuery('.container').outerWidth()>768) ) { if( jQuery( '#carousel-homepage-latestnews div.item' ).length < 2 ) { jQuery( '#carousel-homepage-latestnews > a' ).css('display','none'); } var maxheight = 0; jQuery( '#carousel-homepage-latestnews div.item' ).each(function(){ if( jQuery(this).height() > maxheight ) { maxheight = jQuery(this).height(); } }); jQuery( '#carousel-homepage-latestnews div.item' ).height(maxheight); } } }
che non sembra attaccare nulla all'evento click delle freccette. Sicuro che non manchi qualcosa?
-
non credo... Questo un sito che utilizza lo stesso tema dove le news (che stanno alla fine) funzionano, eccolo qua laurarocca.it/
-
Questa riga mette in pausa il carousel
jQuery('.carousel').carousel('pause');
Se nella console del browser per esempio metto:
jQuery('.carousel').carousel('prev')
allora funziona manualmente. Manca da qualche parte il trigger dei click
-
Puoi provare a commentare queste righe:
jQuery('.carousel-control').click(function() { this.blur(); });
-
L'ho commentata e non è cambiato nulla, oltretutto ricercandola con ctrl+f sembra sparita (l'ho commentata con /* */)
-
e sono andato sul file zerif.js
-
Ho provato in locale, commentando quelle linee per me funziona.
-
sul file zerif.js?
-
Aspe', sembra che funzionasse perche' in locale non carica //tb.altervista.org/js/script.js; puoi provare a commentare questo script?
-
Ho fatto così io
-
script.js non c'è tra i file js
-
Uhm.
Fai questa prova:
1-commenta il javascript zerif.js e carica la pagina
2-apri i developer tools e nelle proprieta' CSS disattiva "position: fixed" per ".preloader", cosi' puoi vedere il contenuto della pagina.Cosi' facendo, per me il carousel funziona, quindi c'e' qualcosa che lo blocca in zerif.js
Fai una prova e fammi sapere
-
o sto sbagliando il posto in cui guardare?
-
Dovrei aver fatto (controlla per favore) però a me non funziona
-
Allora il blocco che causa il problema e' questo:
jQuery(document).ready(function(){ jQuery('#site-navigation a[href*="#"]:not([href="#"]), header.header a[href*="#"]:not([href="#"])').bind('click',function () { var headerHeight; var hash = this.hash; var idName = hash.substring(1); // get id name var alink = this; // this button pressed // check if there is a section that had same id as the button pressed if ( jQuery('section [id*=' + idName + ']').length > 0 && jQuery(window).width() >= 751 ){ jQuery('#site-navigation .current').removeClass('current'); jQuery(alink).parent('li').addClass('current'); }else{ jQuery('#site-navigation .current').removeClass('current'); } if ( jQuery(window).width() >= 751 ) { headerHeight = jQuery('#main-nav').height(); } else { headerHeight = 0; } if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = jQuery(this.hash); target = target.length ? target : jQuery('[name=' + this.hash.slice(1) +']'); if (target.length) { jQuery('html,body').animate({ scrollTop: target.offset().top - headerHeight + 10 }, 1200); return false; } } }); });
Commetando questo blocco la cosa funziona.
-
Adesso funziona anche con la tua copia live
-