Return to 1st image on slideshow

后端 未结 2 360
广开言路
广开言路 2021-01-28 07:26

I asked this question a few days ago and I really need to solve this problem - please help!!

Does anyone know how to add another button to this slideshow that takes the

2条回答
  •  旧巷少年郎
    2021-01-28 08:07

    You can see how they defined a function showNextSlide, and then bound it to the div id slideshow-next; you'll want to define a function showFirstSlide that sets currentSlide equal to 1 and calls the update functions, and then bind it to whatever button you decide on. e.g.

    function showFirstSlide()
    {
      currentSlide=1;
      updateContentHolder();
      updateButtons();
    }
    ...
    $("#slideshow-first").click(showFirstSlide);
    

提交回复
热议问题