To run the code immediately as well as every 5 seconds we'll need to pull the function out of the setInterval so we can call it immediately as well as from inside the setInterval - like this:
Code:
$("#slideshow > div:gt(0)").hide();
var sld = function() {
$('#slideshow > div:first')
.fadeOut(1000)
.next()
.fadeIn(1000)
.end()
.appendTo('#slideshow');
$(function resize() {
$('#slideshow span').css('font-size', '4em');
while( $('#slideshow span').height() > $('#slideshow').height() ) {
$('#slideshow span').css('font-size', (parseInt($('#slideshow span').css('font-size')) - 1) + "px" );
}
});
}
setInterval(sld, 5000);
sld();