Código Javascript:
Ver original
<script type="text/javascript"> //<!-- (function() { var addthis = document.createElement('script'); addthis.type = 'text/javascript'; addthis.async = true; addthis.src = 'http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f157aaf28da46ac'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(addthis, s); })(); window.fbAsyncInit = function() { FB.init({ appId : '176329475780885', channelUrl : '//http://www.tuweb.com/channel.html', // Channel File cookie : true, xfbml : true, oauth : true }); FB.Event.subscribe('auth.login', function(response) { window.location.reload(); }); FB.Event.subscribe("auth.logout", function(response) { window.location.reload(); }); }; (function(d){ var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/es_ES/all.js"; d.getElementsByTagName('head')[0].appendChild(js); }(document)); var sfs_url = 'http://sfs.tuweb.com'; function switchTab(tab) { // Remove active clases $('ul#menu-events a.active').removeClass('active'); _gaq.push(['_trackPageview', window.location.pathname + '/' + tab]); // Set as active and update text var toActive = $('#tab-'+tab).addClass('active'); // Hide shown layer $('div.show').removeClass('show').addClass('hide'); // Show right layer $('#'+tab).removeClass('hide').addClass('show'); }; $(document).ready(function() { /* * News slideshow */ var newsArray = $('#landings ul li'); var newsCount = newsArray.length; var currentNews = 0; var maxNews = 3; function triggerNextNews() { setTimeout(switchNews, 6000); //console.log('Triggering timer ' + currentNews); }; function switchNews() { $('#landings ul li').first().remove(); if ((currentNews +1) < newsCount) { currentNews++; } else { currentNews = 0; } var news = newsArray[currentNews]; $('#landings ul').append(news); triggerNextNews(); }; $('#landings ul li').remove(); newsArray.each(function() { $(this).removeClass('hide'); }) for (var i = 0; i < maxNews; i++) { if (i > newsCount) break; $('#landings ul').append(newsArray[i]); currentNews = i; } // Run triggerNextNews(); }); //--> </script>
y la tabla donde estaban las noticias era así:
Código HTML:
Ver original
<div id="landings"> <ul> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> <li class="hide"> <img src=".jpg" class="fromdb" alt="tituloimagen"/> </ul> </div>
¿Podrian ayudarme para hacerlo funcionar? ¿Que tengo que añadir o datos rellenar en el script?
Muchisimas gracias!!