I tried to apply css with jquery to a div element, but it wont accept the $(this) parameter. I wonder why cant I use $(this) as a referer to the div element.
blabla.css({
'top': $(window).width()/2-$(this).width()/2+'px',
'left': $(window).width()/2-$(this).width()/2+'px'
});
ERROR: Uncaught TypeError: Object # has no method ‘width’
Thanks in advance..
ps: I know I can use here a direct id call inside the $(), but I expected this will work.
if
$(this)isblabla, why not useblabla.width()instead$(this).width()?