I’ve been googling away for a while now and realized I need help.
I’m developing something for a friend of mine in PHP, but he wants a really difficult to program (to me) image slider on his website. I’m Dutch and the example I’m gonna show you is of a Dutch website: http://www.iboma.com/index.asp. I’m trying to make a similar animation but in javascript/jQuery.
Only instead of the sample wood being shown I need to fade in an image and corresponding link. The text might be an extra. It’s not needed.
Standard sliders aren’t good enough so I need custom code. No fancy animations, crossfade would be ideal. After the image has faded in I need an image+link faded in overlaying the background image, also while maintaining the overlaying logo also shown on the example website.
I’d like to feed the image slider images from PHP either with JSON array or pre-loaded on the website (probably search engine friendlier).
var photos = [ { image: "http://localhost/foobar.png", logo: "http://localhost/foobar.png", link: "http://www.stackoverflow.com/" },
{ image: "http://localhost/foobar.png", logo: "http://localhost/foobar.png", link: "http://www.google.com/" },
{ image: "http://localhost/foobar.png", logo: "http://localhost/foobar.png", link: "http://www.yahoo.com/" }];
Could you guys help me on my way developing such an animation?
Starting off:
I’m trying to figure out how to have an efficiënt infinte loop stacking the various events I have to trigger to animate the thing.
First off, do I use normal javascript or am I better off using jQuery regarding load and speed?
Secondly, what’s a good implementation of such code for the infinite loop?
Third, how do I trigger various events after each other not disrupting the flow of the animation.
Fourth, while animation the background-image change how do I make sure the overlaying logo doesn’t disappear behind the animation? This is one of my main issues. Using fadeIn and fadeOut the logo disappears behind my images.
Suggestions?
Finally got what i needed.
Sófka you helped me on my way. Thx for that. It was what i needed.
Oh and I used the Orbit image slider for this.
The following code works for me:
Needed to add some event hooks to the code libary myself but that wasn’t too hard.
HTML: