I have a slideshow that uses images uploaded via imagefield. The images all get displayed on the page and they fade in and out, in order, but without ever disappearing (so they all stay there, on the page, in a row). In the header of the HTML document there is a <script> element for every single image, like this:

<script type="text/javascript">
<!--//--><![CDATA[//><!--
// Set the timer data for a view slideshow.
$(document).ready(function() {
  // These are the divs containing the elements to be displayed in the main div in rotation or mouseover.
  slideshow_data["1"] = new views_slideshow_data(1, 5000, 1, true, "slow", 0.25);

  // This turns on the timer.
  views_slideshow_timer("1", true);

  // This sets up the mouseover & mouseout to pause on the main element.
  $("#views_slideshow_main_1").hover(
    function() {
      views_slideshow_pause("1");
    },
    function() {
      views_slideshow_resume("1");
    });
});
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
// Set the timer data for a view slideshow.
$(document).ready(function() {
  // These are the divs containing the elements to be displayed in the main div in rotation or mouseover.
  slideshow_data["2"] = new views_slideshow_data(1, 5000, 1, true, "slow", 0.25);

  // This turns on the timer.
  views_slideshow_timer("2", true);

  // This sets up the mouseover & mouseout to pause on the main element.
  $("#views_slideshow_main_2").hover(
    function() {
      views_slideshow_pause("2");
    },
    function() {
      views_slideshow_resume("2");
    });
});
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
// Set the timer data for a view slideshow.
$(document).ready(function() {
  // These are the divs containing the elements to be displayed in the main div in rotation or mouseover.
  slideshow_data["3"] = new views_slideshow_data(1, 5000, 1, true, "slow", 0.25);

  // This turns on the timer.
  views_slideshow_timer("3", true);

  // This sets up the mouseover & mouseout to pause on the main element.
  $("#views_slideshow_main_3").hover(
    function() {
      views_slideshow_pause("3");
    },
    function() {
      views_slideshow_resume("3");
    });
});
//--><!]]>
</script>

Is it right that there is a <script> element for each image? Obviously something is not working right with the slideshow.

Comments

robertDouglass’s picture

Status: Active » Fixed

Grouping field under slideshow settings seems to be the key.

I had originally set the grouping field to be the imagefield field, but when I select None instead, the slideshow works.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

drupalninja99’s picture

i am late to the party, where are you getting instructions on how to manipulate views slideshow from js?

eg. slideshow_data["1"] = new views_slideshow_data(1, 5000, 1, true, "slow", 0.25); and so on - is there some readme/tutorial out there?