Created
August 23, 2010 17:24
-
-
Save srobbin/545916 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 position = 0, | |
images = [ | |
'image1.jpg', | |
'image2.jpg', | |
'image3.jpg' | |
]; | |
$.backstretch(images[position]); | |
setInterval(function() { | |
if(position++ > images.length) position = 0; | |
$("#backstretch img").attr("src", images[position]); | |
$(window).trigger("resize"); | |
}, 5000); |
Thanks for responding! paths are correct..the sample without the fade works, but when I add the fade only the first image shows
I tried proto-backstretch with the new fade call and that works, but I'd prefer your method
I ended up just using a combo of backstretch and supersized to make it work.
Sumogray.... The error this pushes back is:
Uncaught TypeError: Object # has no method 'easeOutQuint'
Any ideas? This is exactly what I need to do, so hoping you have an idea/answer.
Thanks.
I ended up combining a couple js files to make it work. Send me a PM and I
can send the files to you.
…On May 26, 2011 10:56 PM, "cjett" < ***@***.***> wrote:
Sumogray.... The error this pushes back is:
Uncaught TypeError: Object #<Object> has no method 'easeOutQuint'
Any ideas? This is exactly what I need to do, so hoping you have an
idea/answer.
Thanks.
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/545916
Sorry for delay, should have said you will need to run a jquery easing plugin for easeOutQuint... have replaced with linear which is included afaik.
Sorry guys.
Hello guys i'm new here and i just HAD to post my working solution.
You will be needing http://plugins.jquery.com/project/timers too.
var position = 0,
images = [
'images/slide1.jpg',
'images/slide2.jpg',
'images/slide3.jpg'
];
$.backstretch(images[position]);
$("body").oneTime(4000,function() {
position++;
$('#backstretch img').fadeOut(1000, function(){$('#backstretch img').attr("src", images[position]).fadeIn(1000)});
$(window).trigger("resize");
$("body").everyTime(5200,function() {
position++;
if(position == images.length){
position = 0;
}
$('#backstretch img').fadeOut(1000, function(){$('#backstretch img').attr("src", images[position]).fadeIn(1000)});
$(window).trigger("resize");
});
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are the paths to the images correct? Do you get any error from console? :)