Search code examples
phpbuttonclickyiiprettyphoto

PHP YII prettyPhoto Button Click


I am using prettyPhoto to create a slideshow of images on website & is working fine by clicking on images. But I want to create a Button Click Event by which slide show automatically starts from image 1 to n.


Solution

  • You can set the autoplay_slideshow to true which enables the slideshow when you load.

    If that is not an option take a look at the PrettyPhoto Documentation, in particular the customisation section. Add your button markup to markup property.

    Another option can be to create a button with your own JS which periodically calls the prettyphoto public API functions such as $.prettyPhoto.changePage('next');