Slide show messing up my slide up?
So I tried my hand at adding a slide show using jquery to the site, but it doesnt seem to be working and now my slide up wont work because of it.
Html
- <h1> Tylers Work</h1>
- <h2 id="caption">How it all got started</h2>
- <img id="slide" src="TylerPic.jpg" alt="">
- <div id="slides">
- <img src="logo1.jpg" alt="Logo 1">
- <img src="logo2.png" alt="Logo 2">
- <img src="logo3.png" alt="Logo 3">
- </div>
Css:
- img{
- height: 250px;
- }
- #slides img{
- display: none;
- }
jQuery
- //Slide up and down button to cover the scroll bar so only the pictures show
- $("#slideUp").click(function(){
- $("#textArea").slideUp();
- });//end slide up
- //Slide up and down button to reveal the scroll bar
- $("#slideDown").click(function(){
- $("#textArea").slideDown();
- });//end slide down
- //Slide Show
- var image, imageCounter = 0, imageCache = [];
- $("#slides img").each(function)() {
- image = new Image();
- image.src = $(this).attr("src");
- image.title = $(this).attr("alt");
- imageCache[imageCounter] = image;
- imageCounter++;
- });
- //Start Slide Show
- imageCounter = 0;
- var nextImage;
- setInterval ( function() {
- $("#caption").fadeOut(1000);
- $("#slide").fadeOut(1000);
- function() {
- imageCounter = (imageCounter + 1) % imageCache.length;
- nextImage = imageCache[imageCounter];
- $("#slide").attr("src", nextImage.src).fadeIn(1000);
- $("#caption").text(nextImage.title).fadeIn(1000);
- }
- };
- },
- 3000);
- });//end ready