Jenny Mok Jenny Mok - 1 year ago 95
CSS Question

Appended but style not updating

var dom = '<div data-id="'+id+'" class="box box_album_item"><div class="album_item" style="background: url('+img_src+') no-repeat center center; background-size: cover; height="'+ $('#album_item .album_item:first').outerWidth() +'px"></div></div>';


everything worked, I'm able to see the height in my dom,

enter image description here

but the height is not applied?

Answer Source

you have mention "height=", you are giving a style not attribute use "height:" instead. var dom = ' ';

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download