moycs777 / galleriffic

Automatically exported from code.google.com/p/galleriffic
0 stars 0 forks source link

Randomize Slideshow? #204

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi-
I can't find any thing about this either in the Issues Queue or on google 
search.  I love the program.  Been using it to set up a test site for my artist 
portfolio.  I would like to have a slideshow on the front page that randomizes, 
however, so that the same image isn't always picked on page refresh.  I added 
"random: true," to the instance load to no avail.  Any thoughts?  Thanks!

Here is my full code:

    // Initialize Advanced Galleriffic Gallery
                                            var gallery = $('#thumbs_front').galleriffic({
                                                delay:                     4000,
                                                numThumbs:                 10,
                                                preloadAhead:              10,
                                                enableTopPager:            false,
                                                enableBottomPager:         false,
                                                imageContainerSel:         '#slideshow_front',
                                                controlsContainerSel:      '#controls_front',
                                                captionContainerSel:       '#caption_front',
                                                loadingContainerSel:       '#loading_front',
                                                renderSSControls:          false,
                                                renderNavControls:         false,
                                                playLinkText:              ' ',
                                                pauseLinkText:             ' ',
                                                prevLinkText:              ' ',
                                                nextLinkText:              '  ',
                                                nextPageLinkText:          'Next ›',
                                                prevPageLinkText:          '‹ Prev',
                                                enableHistory:             false,
                                                autoStart:                 true,
                                                syncTransitions:           true,
                                                random:                    true,
                                                defaultTransitionDuration: 1200,
                                                onSlideChange:             function(prevIndex, nextIndex) {
                                                    // 'this' refers to the gallery, which is an extension of $('#thumbs')
                                                    this.find('ul.thumbs').children()
                                                        .eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
                                                        .eq(nextIndex).fadeTo('fast', 1.0);

                                                    // Update the photo index display
                                                    this.$captionContainer.find('div.photo-index')
                                                        .html('Photo '+ (nextIndex+1) +' of '+ this.data.length);
                                                },
                                                onPageTransitionOut:       function(callback) {
                                                    this.fadeTo('fast', 0.0, callback);
                                                },
                                                onPageTransitionIn:        function() {
                                                    var prevPageLink = this.find('a.prev').css('visibility', 'hidden');
                                                    var nextPageLink = this.find('a.next').css('visibility', 'hidden');

                                                    // Show appropriate next / prev page links
                                                    if (this.displayedPage > 0)
                                                        prevPageLink.css('visibility', 'visible');

                                                    var lastPage = this.getNumPages() - 1;
                                                    if (this.displayedPage < lastPage)
                                                        nextPageLink.css('visibility', 'visible');

                                                    this.fadeTo('fast', 1.0);
                                                }
                                            });

Original issue reported on code.google.com by gauthier...@gmail.com on 6 Apr 2011 at 9:41