I'm trying to set up an function where if the slider I'm using (Royal Slider) is on a certain slide a .load function happens. I'm just not sure how to set it up and have been poking around for a while and can't seem to get it.
sliderInstance.currSlideId // current slide index
How using this would you set it up so when sliderInstance.currSlideId equals a slide value, in this case 2, then
function () {
$('#light_content_container').load('http://www.klossal.com/portfolio/lightseries_content.html');
});
is launched. http://dimsemenov.com/plugins/royal-slider/documentation/?s=dp#api that's the api for the slider, I can't figure out how to get this to work, so any help would be greatly appreciated.
The over all script I currently have:
<script>
jQuery(document).ready(function($) {
var sliderInstance = $('#mySlider').royalSlider({
captionShowEffects:["moveleft", "fade"],
directionNavAutoHide: false,
autoScaleSlider: false,
imageScaleMode:"fit", // Scale mode of all images. Can be "fill", "fit"
or "none"
imageAlignCenter:true,
navigateByClick:false,
keyboardNavEnabled:true,
controlNavThumbs:true,
directionNavEnabled: true,
startSlideId: 1,
deeplinking: {
// fullscreen options go gere
enabled: true,
prefix: 'slider_port-'
},
afterSlideChange:function() {
xx=this.currSlideId;
$('#thumb_scroll li').removeClass('library_thumb_active');
$('#thumb_scroll li').eq(xx).addClass('library_thumb_active');
},
}).data('royalSlider');
$("#makingof_goto").click(function() {
sliderInstance.goTo(0);
});
$("#space_goto").click(function() {
sliderInstance.goTo(1);
});
$("#light_goto").click(function() {
sliderInstance.goTo(2);
});
$("#faces_goto").click(function() {
sliderInstance.goTo(3);
});
$("#color_goto").click(function() {
sliderInstance.goTo(4);
});
$(document).keydown(function(e){
if (e.keyCode == 37) {
var leftPos = $('#thumb_scroll').scrollLeft();
if(leftPos==0){
$("#thumb_scroll").animate({scrollLeft: leftPos + 348}, 800);
}
else{
$("#thumb_scroll").animate({scrollLeft: leftPos - 150}, 800);
}
}
if (e.keyCode == 39) {
var leftPos = $('#thumb_scroll').scrollLeft();
if(leftPos ==348){
$("#thumb_scroll").animate({scrollLeft: leftPos - 348}, 800);
}
else{
$("#thumb_scroll").animate({scrollLeft: leftPos + 150}, 800);
}
}
});
});
</script>