MediaWiki:Common.js: Difference between revisions
Appearance
Cdjensen94 (talk | contribs) No edit summary |
Cdjensen94 (talk | contribs) 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); | |||
} | |||
}); | }); | ||
}); | }); |