jquery - $('.block').height($(this).width()); causing block height extend -


i trying set block's height equal width $('.block').height($(this).width()); it's not working reason. please see example: http://jsfiddle.net/uy3yb/. need correct?

fiddle demo

$('.block').height(function () {     return $(this).width(); }); 

.height( function(index, height) )

a function returning height set. receives index position of element in set , old height arguments. within function, refers current element in set


problem code

this below window object not $('.block')

$('.block').height($(this).width());  

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -