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!

Recommended Answers

All 2 Replies

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.

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.