<div id="w01">
<img src=qa/01.jpg alt='img'>
<img src=qa/02.jpg alt='img'>
<img src=qa/03.jpg alt='img'>
<img src=qa/04.jpg alt='img'>
</div>
CSS:
#w01 > img{
display:none;
width:100%;
}
#w01 > img:first-child{
display:block;
}
This is starting position. All images are hidden except the first one.
Now I want to create an image gallery using jQuery array.
Click on Next button should move the first image at the bottom of stack, and display the next one.
var arr = $("#w01 > img").toArray();
$('.next').click(function(){
var first = arr[0];
arr.shift(first);
arr[1].show(); //error
});
Error: Uncaught TypeError: undefined is not a function
Is something wrong in the concept, or just in the code, or both?
alert (arr);gives me img objects