Note that there are some explanatory texts on larger screens.

plurals
  1. POimage carousel speeds up each time I click the next image icon
    primarykey
    data
    text
    <p>I have a basic carousel, so far with three images in it. It rotates through the images nice and smoothly, until I click a link which skips from the current image to the next or previous one.</p> <p>On clicking, it goes to the selected image and then seems to speed up the carousel ?</p> <p>Here is the javascript</p> <pre><code>carouselDelay: 7000, carouselFadeDuration: 500, timeouts: null, hpCarouselInTransition: false, imageCarousel: function() { // If we have enough images, run the carousel if ($('#ul_block_hpgallery li').length &gt; 1) { // start the carousel $('#image_gallery_buttons img').each(function() { $(this).click(function() { if ($(this).hasClass('selected')) return; common.homepageSlidesTransition(); }); }); setTimeout(function() { common.homepageSlidesTransition(); }, common.carouselDelay); } }, homepageSlidesTransition: function(requested) { requested = typeof requested !== 'undefined' ? requested : false; if (requested === false &amp;&amp; common.hpCarouselInTransition === true) return; var pPrev = $('#ul_block_hpgallery &gt; li.selected'); var pNext, selectedIndex; if (requested === false) { if (pPrev.next('li').length) pNext = pPrev.next('li'); else pNext = pPrev.siblings('li').first(); } else { common.hpCarouselInTransition = true; pNext = $('#ul_block_hpgallery &gt; li').eq(requested); } selectedIndex = pNext.index(); pPrev.removeClass('selected').addClass('last-selected'); $('#image_gallery_buttons &gt; li').removeClass('selected'); pNext.css({ opacity: 0 }).addClass('selected').animate({ opacity: 1 }, common.carouselFadeDuration, function() { pPrev.removeClass('last-selected'); $('#image_gallery_buttons &gt; li').eq(selectedIndex).addClass('selected'); $('#image_title_display').html(pNext.find('img').attr('alt')) window.setTimeout(function() { common.homepageSlidesTransition(); }, common.carouselDelay + common.carouselFadeDuration); }); }, </code></pre> <p>Source</p> <pre><code>&lt;div id="hp_gallery"&gt; &lt;div id="add_block_hpgallery" class="add_hpGallery"&gt; &lt;ul id="ul_block_hpgallery"&gt; &lt;li id="ig_image_0" class="hpNav0" style="opacity: 1;"&gt; &lt;img alt="Image 3" src="/assets/add_blocks/1_wall2.jpg"&gt; &lt;/li&gt; &lt;li id="ig_image_1" class="hpNav1" style="opacity: 1;"&gt; &lt;li id="ig_image_2" class="hpNav2 selected" style="opacity: 1;"&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="galleryFooter"&gt; &lt;ul id="image_gallery_buttons" class="ulMenu"&gt; &lt;li class="image_gallery_button_holder"&gt; &lt;img id="ig_button_0" class="image_gallery_button ig_button_0" height="19" width="19" alt="" title="" src="/assets/blank.gif"&gt; &lt;/li&gt; &lt;li class="image_gallery_button_holder"&gt; &lt;li class="image_gallery_button_holder selected"&gt; &lt;/ul&gt; &lt;div id="image_title_display"&gt;Image 2&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload