When developing with Firebug, I keep getting this error.
pages [x] .css ("z-index", x) is not a function
The function itself works great, but I'm trying to figure out why it continues to celebrate this. The function simultaneously reorganizes the array and z-indices. Can I not access array variables and calls to them like this, or is it something else?
full code:
var pages = $("#use-wrapper").children("div");
pages.children("a.right").click(function(event) {
event.preventDefault();
$(this).parent("div").css("z-index","0");
pages.push($(this).parent("div"));
for(var x = pages.length; x >= 1; --x) {
pages[x] = pages[x-1];
pages[x].css("z-index",x);
}
pages[0] = pages.pop();
});
source
share