Created
May 16, 2015 02:25
-
-
Save tleen/ea661ecdfa904f26324b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var images_to_captions = { | |
"pic1.jpg" : "This is pic one", | |
"pic2.jpg" : "second pic is here", | |
"pic3.jpg" : "blargh", | |
} | |
$.BgSwitcher.defineEffect("fadeAndSwitchText", function($el) { | |
$el.animate({opacity: 0}, this.config.duration, this.config.easing, function(){ | |
// new slide so switch text here | |
var currentimage = '?';// get this from the css or the context or something | |
var caption = images_to_captions[currentimage]; | |
$('#caption-box-id').text(caption); | |
}); | |
}); | |
$(".box").bgswitcher({ | |
images: ["pic1.jpg", "pic2.jpg", "pic3.jpg"], | |
effect: "fadeAndSwitchText" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment