Hopefully this is a quick easy one for you.
Here is my code:
var p7slide = 0;
$("#p7-forward").click (function () {
p7animate = null;
if (p7slide == 6) {
$("#p7-6").fadeOut("slow", function () {
p7slide = 0;
});
}
else {
p7slide++;
$("#p7-" + p7slide).fadeIn("slow");
<!--$("#p7-" + "p7slide - 1").fadeOut("slow");-->
};
});
The part i refer to is the commented out line in the else statement.
What i need this to do is to find p7slide and take 1 from this value. Then use that as the selector. E.g. If p7slide = 2 the selector would put together #p7-1. For some reason this statement isn't working.
Any ideas what Ive done wrong here?
Thanks