I wrote the code for a jquery slider... it doesn't seem to work... can someone tell me why it doesn't work??? Could it be because jquery is installed wrong or it can't find it?
Here is my code (I did this all in 1 file)
<title>Slider</title>
</head>
<script src="jquery-1.7.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
setInterval ("rotateImages()", 2000);
});
function rotateImages() {
var oCurPhoto = $("#photoShow div.current");
var oNxtPhoto = oCurPhoto.next ();
if (oNxtPhoto.length == 0)
oNxtPhoto = $("#photoShow div: first");
oCurPhoto.removeClass('current').addClass('previous');
oNxtPhoto.css({ opacity: 0.0}).addClass('current').animate({ opacity: 1.0 }, 1000, );
function () {
oCurPhoto.removeClass('previous');
});
}
<style type="text/css">
#photoShow {
width: 1200px;
height: 488px;
}
#photoShow > div {
position: absolute;
z-index: 0;
}
#photoShow div.previous {
z-index: 1;
}
#photoShow div.current {
z-index: 2;
}
</style>
<body>
<div id="photoShow">
<div class="current">
<div>
<img src="img1.png" alt="Photo Gallery" width="1200" height="488" class="gallery"/>
</div>
<div>
<img src="img2.png" alt="Photo Gallery" width="1200" height="488" class="gallery"/>
</div>
<div>
<img src="img3.png" alt="Photo Gallery" width="1200" height="488" class="gallery"/>
</div>
</div>
</body>
</html>