jquery width() with newly generated element -


when use following :

div = '<div class="tag-tooltip" id="tooltip_view_1">first item</div>'; $('#products').append(div);  var tooltip_width = $('#tooltip_view_1').width();  var tooltip_height = $('#tooltip_view_1').height(); 

the tooltip_height gives correct value, while tooltip_width returns 0. idea why happening , should width of newly created element?

just i've solved problem - appears css property : text-indent affecting visibility of element. had set negative value , once removed property altogether - started working fine.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

php - Time zone issue -

iphone - Using nested NSDictionary with Picker -