<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Incredibile malfunzionamento su slider ajax]]></title><description><![CDATA[<p dir="auto">Ciao a tutti,credo di avere un problema di javascript: se andate su newsliguria[punto]com potete notare che lo slider in home ha un caption che presenta un titolo e un excerpt (un riassunto del post) di wordpress. La cosa strana, è che se lo fate girare un pò di volte (le immagini che ruotano sono solo 4 ) i riassunti progressivamente  spariscono, prima da uno solo, poi da due e infine vedete ruotare solo le immagini dei titoli.<br />
A me non è mai capitato di vedere una malfunzionamento "progressivo", di solito le cose o vanno o non vanno!<br />
Non so che pesci prendere, di seguito vi passo il codice .js che ho leggerissimamamente modificato dall' originale, per far ruotare le immagini e i captions, e il codiche php che genera la lista di immagini.</p>
<pre><code>$(document).ready(function() {        
    
    //Execute the slideShow, set 4 seconds for each images
    slideShow(5000);

});

function slideShow(speed) {


    //append a LI item to the UL list for displaying caption
    $('ul.slideshow').append('&lt;li id="slideshow-caption" class="caption"&gt;&lt;div class="slideshow-caption-container"&gt;&lt;h3&gt;&lt;/h3&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/li&gt;');

    //Set the opacity of all images to 0
    $('ul.slideshow li').css({opacity: 0.0});
    
    //Get the first image and display it (set it to full opacity)
    $('ul.slideshow li:first').css({opacity: 1.0});
    
    //Get the caption of the first image from REL attribute and display it .attr('alt')
    $('#slideshow-caption h3').html($('ul.slideshow li:first').find('a').attr('title'));
    $('#slideshow-caption p').html($('ul.slideshow li:first').find('span.descrip'));
        
    //Display the caption
    $('#slideshow-caption').css({opacity: 0.7, bottom:0});
    
    //Call the gallery function to run the slideshow    
    var timer = setInterval('gallery()',speed);
    
    //pause the slideshow on mouse over
    $('ul.slideshow').hover(
        function () {
            clearInterval(timer);    
        },     
        function () {
            timer = setInterval('gallery()',speed);            
        }
    );
    
}

function gallery() {


    //if no IMGs have the show class, grab the first image
    var current = ($('ul.slideshow li.show')?  $('ul.slideshow li.show') : $('#ul.slideshow li:first'));

    //Get next image, if it reached the end of the slideshow, rotate it back to the first image
    var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
        
    //Get next image caption .attr('alt')
    var title = next.find('a').attr('title');    
    var desc = next.find('span.descrip');    
        
    //Set the fade in effect for the next image, show class has higher z-index
    next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
    
    //Hide the caption first, and then set and display the caption
    $('#slideshow-caption').animate({left:580}, 300, function () {
            //Display the content
            $('#slideshow-caption h3').html(title);
            $('#slideshow-caption p').html(desc);                
            $('#slideshow-caption').animate({left:405}, 500);    
    });        

    //Hide the current image
    current.animate({opacity: 0.0}, 1000).removeClass('show');

}
</code></pre>
<pre><code>&lt;ul class="slideshow" &gt;
 &lt;?php
 $my_query = new WP_Query('showposts=4');
 while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post();
 $belin = catch_that_image();
 ?&gt;
 

 &lt;li &lt;?php if($count == 0){ echo"class='show'";} else{ echo"";} $count++; ?&gt;  &gt; 
 &lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;a href='&lt;?php the_permalink(); ?&gt;'&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;"&gt;
 &lt;img src="vuvuvu[punto]newsliguria[punto]com/resize.php?url=&lt;?php echo $belin ?&gt;&amp;size=585x250c50" alt="" /&gt;&lt;/a&gt;
 &lt;span class="descrip"&gt;
 &lt;?php the_advanced_excerpt('length=160&amp;use_words=0&amp;no_custom=1&amp;ellipsis=%26hellip;&amp;exclude_tags=img');
?&gt;&lt;/span&gt;
 &lt;/li&gt;

 &lt;?php endwhile; ?&gt; &lt;/ul&gt;
</code></pre>
<p dir="auto">Un aiutino please!</p>
]]></description><link>https://dev.connect.gt/topic/121412/incredibile-malfunzionamento-su-slider-ajax</link><generator>RSS for Node</generator><lastBuildDate>Sun, 29 Nov 2026 14:26:36 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/121412.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Feb 2010 14:08:36 GMT</pubDate><ttl>60</ttl></channel></rss>