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

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -