To double the width of img
, I can do this in jQuery:
<img src='blah.jpg' id='pic' /> $('#pic').height($(this).height()*2);
which works great, but I really enjoy using shorthand jobs, for example:
var count = 5; count *= 2;
Since element.height
returns a height function in jQuery, I cannot use shorthand jobs. Is it not possible to perform short jobs in jQuery for element attributes?
source share