I'm having trouble getting my array elements defined. When I try to alert them, I always receive NaN. Even though the jQuery selectors seem to be working perfectly. Can someone help me figure out what the problem might be?
var sldr = $("#slider img"),
count = sldr.length-1,
containerHeight = $("#slider").css('height'),
images = new Array(),
imgHeights = new Array(),
imgWidths = new Array(),
imgSlices = new Array(),
choosenSlice = '',
slicer = '';
var i=0;
for (i=0;i<=count;i++){
images[i] = $("#slider img:eq("+i+")");
imgHeights[i] = $("#slider img:eq("+i+")").attr('height');
imgWidths[i] = $("#slider img:eq("+i")").attr('width');
imgSlices[i] = (Math.round(imgHeights[i]/containerHeight))-1;
alert(imgSlices[i]);
}