0

I was creating a jQuery slider and I can't get the slider to even work... Can someone help me out with this question?

Much appreciated if anyone can help!...

Here is my code:
HTML:

<div id="slider img">
<div id="slideshow">
   <div>
     <img src="img1.png">
   </div>
   <div>
     <img src="img2.png">
   </div>
   <div>
     <img src="img3.png">
   </div>
</div>
</div>

CSS:

#slideshow { 
    margin: 50px auto; 
    position: relative; 
    width: 1200px; 
    height: 488px; 
    padding: 10px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.4); 
}

#slideshow > div { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    right: 10px; 
    bottom: 10px; 
}

jQuery:

$("#slideshow > div:gt(0)").hide();

setInterval(function() { 
  $('#slideshow > div:first')
    .fadeOut(1000)
    .next()
    .fadeIn(1000)
    .end()
    .appendTo('#slideshow');
},  3000);

Full Code:

<------------CSS------------>
</head>
<style>
#slideshow { 
    margin: 50px auto; 
    position: relative; 
    width: 1200px; 
    height: 488px; 
    padding: 10px; 
    box-shadow: 0 0 20px rgba(0,0,0,0.4); 
}

#slideshow > div { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    right: 10px; 
    bottom: 10px; 
}
</style>



<---------jQuery is here----------->
<script>
$("#slideshow > div:gt(0)").hide();

setInterval(function() { 
  $('#slideshow > div:first')
    .fadeOut(1000)
    .next()
    .fadeIn(1000)
    .end()
    .appendTo('#slideshow');
},  3000);

</script>



<body>
<---------Html---------->

<div id="slider img">
<div id="slideshow">
   <div>
     <img src="img1.png">
   </div>
   <div>
     <img src="img2.png">
   </div>
   <div>
     <img src="img3.png">
   </div>
</div>
</div>




</body>
</html>

Please Respond a.s.a.p!
Thanks!

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by <M/>
0

Can someone help me out with this question?

What question? There isn't one.

Please Respond a.s.a.p!

"Please" is cool but use of the imperative is not. Also, "a.s.a.p!" is a great way to be ignored.

0

I just asked if someone can help me fix the code for the slider???

And i'll be sure not to add that in a message

So back to the question... do you see what I did wrong?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.