i have a little problem here.
I've created an array where i want to put my ids, but when i use this bit of code, the result is not what i was expecting and i don't know why:
var ids = ['#biography', '#videogallery', '#pubblications', '#contacts', '#resume'];
console.debug(ids);
var currentElem = "";
$(window).load(function () {
var vWidth = $(window).width();
var vHeight = $(window).height();
$(ids).each(function() {
var currentElem = $(this);
console.debug(currentElem)
$(currentElem).css('width', vWidth).css('height', vHeight);
})
});
basically what i want is to set up the height and width only for specific ids, but the result of the each is something like this:
"#", "b", "i", "o", "g", "r", "a", "p", "h", "y", jquery: "2.1.3", constructor: function, selector: "", toArray: function, get: function…]0: "#"1: "b"2: "i"3: "o"4: "g"5: "r"6: "a"7: "p"8: "h"9: "y"length: 10__proto__: te[0]
why? and how can i solve this? thank in advance