Jump to content

MediaWiki:Common.js: Difference between revisions

No edit summary
No edit summary
Line 34: Line 34:
             $slideshow.slick('setPosition');
             $slideshow.slick('setPosition');
         });
         });
    });
});
$(document).ready(function() {
    var counter = 1;
    $('.slideshow').each(function() {
        var $this = $(this);
        if (!$this.attr('id')) {
            // Assign an auto id if missing
            var newId = 'slideshow-auto-' + (counter++);
            $this.attr('id', newId);
            // Add the missing spacer
            if ($('#' + newId + '-spacer').length === 0) {
                $('<div>')
                    .attr('id', newId + '-spacer')
                    .insertAfter($this);
            }
            // Force JavascriptSlideshow to initialize this slideshow
            startSlideshow(newId);
        }
     });
     });
});
});