.message { text-align: center; }
#wrapper { width: 400px; height: 300px; margin: 20px auto; } /* used when "expand" is true */
#slider { width: 400px; height: 300px;}
/* Conditional comments don't work in this playground, If testing in IE7 or older browsers, uncomment out the CSS below:
Also note, this may not work properly on themes other than the default as the chosen theme stylesheet is loaded after this CSS and will over-ride it */
/*
div.anythingSlider .arrow {
top: 35% !important;
}
div.anythingSlider-metallic .arrow {
top: 40% !important;
}
div.anythingSlider-construction .arrow {
top: 14% !important;
}
div.anythingSlider-minimalist-round .arrow , div.anythingSlider-minimalist-square .arrow {
top: 45% !important;
}
div.anythingSlider-cs-portfolio .arrow {
bottom: -24px !important;
}
div.anythingSlider .arrow a,
div.anythingSlider-metallic .arrow a,
div.anythingSlider-minimalist-square .arrow a,
div.anythingSlider-construction .arrow a,
div.anythingSlider-minimalist-round .arrow a {
margin: 0 !important;
}
*/
JavaScript
$('#slider').anythingSlider({
// *********** Appearance ***********
// Override the default CSS width
width: 300,
// Override the default CSS height
height: 200,
// If autoPlay is on, this can force it to start stopped
startStopped: true,
// *********** Callbacks ***********
// Callback when the plugin finished initializing
onInitialized: function(e, slider) {
var start = slider.options.startPanel;
// allow cloned panel images to load
slider.$el.find('.panel').eq(start).siblings(':not(.cloned)')
.find('img').each(function(){
var $el = $(this);
$el.attr('src', function(i, src){
$el.attr('data-src', src);
return '';
});
});
},
// Callback when slide initiates, before control animation
onSlideInit: function(e, slider) {
slider.$targetPage.find('img').each(function(){
if ($(this).attr('src') === '') {
var newsrc = $(this).attr('data-src');
$(this).attr('src', newsrc);
// show loading message
$('.message').html('loading: ' + newsrc).stop(true,true).fadeIn().delay(1000).fadeOut();
}
});
}
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.